Apply clippy suggestions

This commit is contained in:
Dirkjan Ochtman 2022-11-29 16:04:24 +01:00
parent 6b3fa93f69
commit 4768d092ca
3 changed files with 6 additions and 6 deletions

View File

@ -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 = syn::LifetimeDef::new(syn::Lifetime::new("'xml", Span::call_site()));
xml.bounds.extend(borrowed.into_iter());

View File

@ -34,9 +34,9 @@ impl<'cx, 'xml> Deserializer<'cx, 'xml> {
match self.next() {
Some(Ok(Node::AttributeValue(s))) => Ok(s),
Some(Ok(Node::Text(s))) => Ok(s),
Some(Ok(node)) => return Err(Error::ExpectedScalar(format!("{node:?}"))),
Some(Err(e)) => return Err(e),
None => return Err(Error::MissingValue(&Kind::Scalar)),
Some(Ok(node)) => Err(Error::ExpectedScalar(format!("{node:?}"))),
Some(Err(e)) => Err(e),
None => Err(Error::MissingValue(&Kind::Scalar)),
}
}
@ -137,7 +137,7 @@ impl<'xml> Context<'xml> {
Ok(Id {
ns: match (element.default_ns, element.prefix) {
(_, Some(prefix)) => match element.level.prefixes.get(prefix) {
Some(ns) => *ns,
Some(ns) => ns,
None => match self.lookup(prefix) {
Some(ns) => ns,
None => return Err(Error::UnknownPrefix(prefix.to_owned())),

View File

@ -318,7 +318,7 @@ impl<'xml, T: FromXml<'xml>> FromXml<'xml> for Option<T> {
*into = Some(Some(value));
Ok(())
}
None => return Err(Error::MissingValue(&<T as FromXml<'_>>::KIND)),
None => Err(Error::MissingValue(&<T as FromXml<'_>>::KIND)),
}
}
}