1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

fix(clippy): uninlined_format_args

This commit is contained in:
Gabriele Belluardo 2025-06-17 00:17:10 +02:00
parent e8b6561d4c
commit 05735887b9
No known key found for this signature in database
GPG key ID: 21671B8C89CCBF4F
6 changed files with 8 additions and 9 deletions

View file

@ -270,7 +270,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
Err(e) => {
return Err(USimpleError::new(
1,
format!("invalid format {} ({e})", format_string),
format!("invalid format {format_string} ({e})"),
));
}
},

View file

@ -745,7 +745,7 @@ impl<'a> Pager<'a> {
&format!("{}{pattern}{}", Attribute::Reverse, Attribute::Reset),
);
};
self.stdout.write_all(format!("\r{}\n", line).as_bytes())?;
self.stdout.write_all(format!("\r{line}\n").as_bytes())?;
lines_printed += 1;
index += 1;
}
@ -792,7 +792,7 @@ impl<'a> Pager<'a> {
if percentage >= 100 {
" (END)".to_string()
} else {
format!(" ({}%)", percentage)
format!(" ({percentage}%)")
}
}
} else {

View file

@ -390,7 +390,7 @@ fn format_and_print_whitespace(s: &str, options: &NumfmtOptions) -> Result<()> {
}
let eol = if options.zero_terminated { '\0' } else { '\n' };
print!("{}", eol);
print!("{eol}");
Ok(())
}

View file

@ -81,7 +81,7 @@ impl FilterMode {
1,
get_message_with_args(
"tail-error-invalid-number-of-bytes",
HashMap::from([("arg".to_string(), format!("'{}'", e))]),
HashMap::from([("arg".to_string(), format!("'{e}'"))]),
),
));
}

View file

@ -72,7 +72,7 @@ impl Display for BadSequence {
"{}",
get_message_with_args(
"tr-error-invalid-repeat-count",
HashMap::from([("count".to_string(), format!("'{}'", count))])
HashMap::from([("count".to_string(), format!("'{count}'"))])
)
)
}

View file

@ -174,8 +174,7 @@ fn create_bundle(
bundle.add_resource(resource).map_err(|errs| {
LocalizationError::Bundle(format!(
"Failed to add resource to bundle for {}: {:?}",
locale, errs
"Failed to add resource to bundle for {locale}: {errs:?}",
))
})?;
@ -276,7 +275,7 @@ fn detect_system_locale() -> Result<LanguageIdentifier, LocalizationError> {
.unwrap_or(DEFAULT_LOCALE)
.to_string();
LanguageIdentifier::from_str(&locale_str).map_err(|_| {
LocalizationError::ParseLocale(format!("Failed to parse locale: {}", locale_str))
LocalizationError::ParseLocale(format!("Failed to parse locale: {locale_str}"))
})
}