Use &AnyString::as_as_str()
This commit is contained in:
parent
28643fc2c2
commit
e925865767
@ -415,13 +415,9 @@ pub trait ToAsString {
|
|||||||
impl ToAsString for OneOrMany<&AnyString> {
|
impl ToAsString for OneOrMany<&AnyString> {
|
||||||
fn to_as_string(&self) -> Option<String> {
|
fn to_as_string(&self) -> Option<String> {
|
||||||
if let Some(prop) = self.as_one() {
|
if let Some(prop) = self.as_one() {
|
||||||
prop.as_xsd_string()
|
prop.as_as_str()
|
||||||
.or_else(|| prop.as_rdf_lang_string().map(|ls| ls.value.as_str()))
|
|
||||||
} else if let Some(props) = self.as_many() {
|
} else if let Some(props) = self.as_many() {
|
||||||
props.iter().next().and_then(|prop| {
|
props.iter().next().and_then(|prop| prop.as_as_str())
|
||||||
prop.as_xsd_string()
|
|
||||||
.or_else(|| prop.as_rdf_lang_string().map(|ls| ls.value.as_str()))
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user