is_err create

This commit is contained in:
Elijah McMorris 2023-12-16 17:11:54 -08:00
parent 4ea36f78b7
commit 2edaeef042
Signed by: NexVeridian
SSH key fingerprint: SHA256:bsA1SKZxuEcEVHAy3gY1HUeM5ykRJl0U0kQHQn0hMg8
2 changed files with 31 additions and 15 deletions

View file

@ -75,7 +75,7 @@ impl EntityMini {
id: Some(get_id_entity(&entity)),
label: get_name(&entity),
claims: thing_claim,
description: get_description(&entity).unwrap_or("".to_string()),
description: get_description(&entity),
},
)
}
@ -129,9 +129,10 @@ fn get_name(entity: &Entity) -> String {
.unwrap_or_default()
}
fn get_description(entity: &Entity) -> Option<String> {
fn get_description(entity: &Entity) -> String {
entity
.descriptions
.get(&Lang(WIKIDATA_LANG.to_string()))
.cloned()
.unwrap_or_default()
}