Skip to content

Commit

Permalink
run clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
magiclen committed Dec 13, 2022
1 parent 5e93fb6 commit 9919f55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/adjusted_byte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl<'de> Deserialize<'de> for AdjustedByte {
E: DeError,
{
if v < 0 {
Err(DeError::invalid_value(Unexpected::Other(format!("integer `{}`", v).as_str()), &self))
Err(DeError::invalid_value(Unexpected::Other(format!("integer `{v}`").as_str()), &self))
} else {
#[cfg(feature = "u128")]
{
Expand Down
2 changes: 1 addition & 1 deletion src/byte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ impl<'de> Deserialize<'de> for Byte {
E: DeError,
{
if v < 0 {
Err(DeError::invalid_value(Unexpected::Other(format!("integer `{}`", v).as_str()), &self))
Err(DeError::invalid_value(Unexpected::Other(format!("integer `{v}`").as_str()), &self))
} else {
#[cfg(feature = "u128")]
{
Expand Down
6 changes: 3 additions & 3 deletions src/byte_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ impl Display for ValueIncorrectError {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), fmt::Error> {
match self {
ValueIncorrectError::Negative(value) => {
f.write_fmt(format_args!("The value `{}` is negative.", value))
f.write_fmt(format_args!("The value `{value}` is negative."))
}
ValueIncorrectError::NotNumber(c) => {
f.write_fmt(format_args!("The character {:?} is not a number.", c))
f.write_fmt(format_args!("The character {c:?} is not a number."))
}
ValueIncorrectError::NoValue => f.write_str("No value."),
}
Expand Down Expand Up @@ -54,7 +54,7 @@ impl Display for UnitIncorrectError {

if expected_characters_length > 1 {
for c in self.expected_characters[1..].iter().take(expected_characters_length - 2) {
f.write_fmt(format_args!(", {:?}", c))?;
f.write_fmt(format_args!(", {c:?}"))?;
}
}

Expand Down

0 comments on commit 9919f55

Please sign in to comment.