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"
version = "0.1.0"
edition = "2021"
rust-version = "1.58"
workspace = ".."
license = "Apache-2.0 OR MIT"

View File

@ -271,7 +271,7 @@ fn named_field(
quote!(""),
syn::Error::new(
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(),
),

View File

@ -2,6 +2,7 @@
name = "instant-xml"
version = "0.1.0"
edition = "2021"
rust-version = "1.58"
workspace = ".."
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())));
}
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 => {}
},
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))),
}
}

View File

@ -86,7 +86,7 @@ impl<'xml, W: fmt::Write + ?Sized> Serializer<'xml, W> {
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;
Ok(())
}