Apply clippy suggestions
This commit is contained in:
parent
6b3fa93f69
commit
4768d092ca
|
@ -74,7 +74,7 @@ impl<'input> ContainerMeta<'input> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn xml_generics<'a>(&self, borrowed: BTreeSet<syn::Lifetime>) -> Generics {
|
fn xml_generics(&self, borrowed: BTreeSet<syn::Lifetime>) -> Generics {
|
||||||
let mut xml_generics = self.input.generics.clone();
|
let mut xml_generics = self.input.generics.clone();
|
||||||
let mut xml = syn::LifetimeDef::new(syn::Lifetime::new("'xml", Span::call_site()));
|
let mut xml = syn::LifetimeDef::new(syn::Lifetime::new("'xml", Span::call_site()));
|
||||||
xml.bounds.extend(borrowed.into_iter());
|
xml.bounds.extend(borrowed.into_iter());
|
||||||
|
|
|
@ -34,9 +34,9 @@ impl<'cx, 'xml> Deserializer<'cx, 'xml> {
|
||||||
match self.next() {
|
match self.next() {
|
||||||
Some(Ok(Node::AttributeValue(s))) => Ok(s),
|
Some(Ok(Node::AttributeValue(s))) => Ok(s),
|
||||||
Some(Ok(Node::Text(s))) => Ok(s),
|
Some(Ok(Node::Text(s))) => Ok(s),
|
||||||
Some(Ok(node)) => return Err(Error::ExpectedScalar(format!("{node:?}"))),
|
Some(Ok(node)) => Err(Error::ExpectedScalar(format!("{node:?}"))),
|
||||||
Some(Err(e)) => return Err(e),
|
Some(Err(e)) => Err(e),
|
||||||
None => return Err(Error::MissingValue(&Kind::Scalar)),
|
None => Err(Error::MissingValue(&Kind::Scalar)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ impl<'xml> Context<'xml> {
|
||||||
Ok(Id {
|
Ok(Id {
|
||||||
ns: match (element.default_ns, element.prefix) {
|
ns: match (element.default_ns, element.prefix) {
|
||||||
(_, Some(prefix)) => match element.level.prefixes.get(prefix) {
|
(_, Some(prefix)) => match element.level.prefixes.get(prefix) {
|
||||||
Some(ns) => *ns,
|
Some(ns) => ns,
|
||||||
None => match self.lookup(prefix) {
|
None => match self.lookup(prefix) {
|
||||||
Some(ns) => ns,
|
Some(ns) => ns,
|
||||||
None => return Err(Error::UnknownPrefix(prefix.to_owned())),
|
None => return Err(Error::UnknownPrefix(prefix.to_owned())),
|
||||||
|
|
|
@ -318,7 +318,7 @@ impl<'xml, T: FromXml<'xml>> FromXml<'xml> for Option<T> {
|
||||||
*into = Some(Some(value));
|
*into = Some(Some(value));
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
None => return Err(Error::MissingValue(&<T as FromXml<'_>>::KIND)),
|
None => Err(Error::MissingValue(&<T as FromXml<'_>>::KIND)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue