Fix clippy lints

This commit is contained in:
Dirkjan Ochtman 2023-02-17 12:46:50 +01:00
parent 60898cdf16
commit 7e05d35ba6
5 changed files with 6 additions and 4 deletions

View File

@ -2,6 +2,7 @@
name = "instant-xml-macros" name = "instant-xml-macros"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
rust-version = "1.58"
workspace = ".." workspace = ".."
license = "Apache-2.0 OR MIT" license = "Apache-2.0 OR MIT"

View File

@ -271,7 +271,7 @@ fn named_field(
quote!(""), quote!(""),
syn::Error::new( syn::Error::new(
field_meta.ns.uri.span(), field_meta.ns.uri.span(),
&format!("unknown prefix `{prefix}` (prefix must be defined on the field's type)"), format!("unknown prefix `{prefix}` (prefix must be defined on the field's type)"),
) )
.into_compile_error(), .into_compile_error(),
), ),

View File

@ -2,6 +2,7 @@
name = "instant-xml" name = "instant-xml"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
rust-version = "1.58"
workspace = ".." workspace = ".."
license = "Apache-2.0 OR MIT" license = "Apache-2.0 OR MIT"

View File

@ -322,10 +322,10 @@ impl<'xml> Iterator for Context<'xml> {
return Some(Ok(Node::Text(text.as_str()))); return Some(Ok(Node::Text(text.as_str())));
} }
Ok(Token::Declaration { .. }) => match self.stack.is_empty() { Ok(Token::Declaration { .. }) => match self.stack.is_empty() {
false => return Some(Err(Error::UnexpectedToken(format!("{:?}", token)))), false => return Some(Err(Error::UnexpectedToken(format!("{token:?}")))),
true => {} true => {}
}, },
Ok(token) => return Some(Err(Error::UnexpectedToken(format!("{:?}", token)))), Ok(token) => return Some(Err(Error::UnexpectedToken(format!("{token:?}")))),
Err(e) => return Some(Err(Error::Parse(e))), Err(e) => return Some(Err(Error::Parse(e))),
} }
} }

View File

@ -86,7 +86,7 @@ impl<'xml, W: fmt::Write + ?Sized> Serializer<'xml, W> {
return Err(Error::UnexpectedState("invalid state for scalar")); return Err(Error::UnexpectedState("invalid state for scalar"));
} }
self.output.write_fmt(format_args!("{}", value))?; self.output.write_fmt(format_args!("{value}"))?;
self.state = State::Element; self.state = State::Element;
Ok(()) Ok(())
} }