From e9258657670142ca2e33b887c89849e98db2fd7a Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Sun, 13 Feb 2022 00:59:36 +0900 Subject: [PATCH] Use &AnyString::as_as_str() --- plume-common/src/activity_pub/mod.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plume-common/src/activity_pub/mod.rs b/plume-common/src/activity_pub/mod.rs index e4fcc655..8a5c9590 100644 --- a/plume-common/src/activity_pub/mod.rs +++ b/plume-common/src/activity_pub/mod.rs @@ -415,13 +415,9 @@ pub trait ToAsString { impl ToAsString for OneOrMany<&AnyString> { fn to_as_string(&self) -> Option { if let Some(prop) = self.as_one() { - prop.as_xsd_string() - .or_else(|| prop.as_rdf_lang_string().map(|ls| ls.value.as_str())) + prop.as_as_str() } else if let Some(props) = self.as_many() { - props.iter().next().and_then(|prop| { - prop.as_xsd_string() - .or_else(|| prop.as_rdf_lang_string().map(|ls| ls.value.as_str())) - }) + props.iter().next().and_then(|prop| prop.as_as_str()) } else { None }