From 5395da806a92a05e127f2d71d92cc16859f4fd13 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Fri, 27 Jun 2025 11:09:25 +0200 Subject: [PATCH] clippy: fix warnings from uninlined_format_args --- src/error.rs | 2 +- src/internal.rs | 4 ++-- src/positional.rs | 2 +- tests/coreutils/cksum.rs | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/error.rs b/src/error.rs index 2c168fa..7752d2d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -105,7 +105,7 @@ impl Display for ErrorKind { Ok(()) } ErrorKind::UnexpectedArgument(arg) => { - write!(f, "Found an invalid argument '{}'.", arg) + write!(f, "Found an invalid argument '{arg}'.") } ErrorKind::UnexpectedValue { option, value } => { write!( diff --git a/src/internal.rs b/src/internal.rs index b74dedd..51a8825 100644 --- a/src/internal.rs +++ b/src/internal.rs @@ -134,14 +134,14 @@ pub fn print_flags( } }; let help_indent = " ".repeat(width - flags.len() + 2); - writeln!(w, "{}{}", help_indent, line).unwrap(); + writeln!(w, "{help_indent}{line}").unwrap(); } else { writeln!(w).unwrap(); } let help_indent = " ".repeat(width + indent_size + 2); for line in help_lines { - writeln!(w, "{}{}", help_indent, line).unwrap(); + writeln!(w, "{help_indent}{line}").unwrap(); } } } diff --git a/src/positional.rs b/src/positional.rs index b8b0640..73eceb7 100644 --- a/src/positional.rs +++ b/src/positional.rs @@ -209,7 +209,7 @@ fn assert_empty(mut operands: Vec) -> Result<(), Error> { if let Some(arg) = operands.pop() { return Err(Error { exit_code: 1, - kind: ErrorKind::UnexpectedArgument(format!("{:?}", arg)), + kind: ErrorKind::UnexpectedArgument(format!("{arg:?}")), }); } Ok(()) diff --git a/tests/coreutils/cksum.rs b/tests/coreutils/cksum.rs index b6a8086..0aa8567 100644 --- a/tests/coreutils/cksum.rs +++ b/tests/coreutils/cksum.rs @@ -91,8 +91,7 @@ fn assert_format(args: &[&str], expected: ResultingFormat) { assert_eq!( (result.0.format(), result.1.as_slice()), (expected, [].as_slice()), - "{:?}", - args + "{args:?}" ); }