mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
Merge pull request #8303 from nyurik/inefficient_to_string
chore: cleanup `inefficient_to_string` lint
This commit is contained in:
commit
2f16b14d6c
6 changed files with 13 additions and 14 deletions
|
@ -645,7 +645,6 @@ redundant_else = "allow" # 58
|
|||
map_unwrap_or = "allow" # 54
|
||||
cast_precision_loss = "allow" # 52
|
||||
unnested_or_patterns = "allow" # 40
|
||||
inefficient_to_string = "allow" # 38
|
||||
unnecessary_wraps = "allow" # 37
|
||||
cast_lossless = "allow" # 33
|
||||
ignored_unit_patterns = "allow" # 29
|
||||
|
|
|
@ -152,7 +152,7 @@ mod tests {
|
|||
}
|
||||
|
||||
fn obsolete_result(src: &[&str]) -> Option<Result<Vec<String>, ParseError>> {
|
||||
Some(Ok(src.iter().map(|s| s.to_string()).collect()))
|
||||
Some(Ok(src.iter().map(|s| (*s).to_string()).collect()))
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -38,7 +38,7 @@ enum NohupError {
|
|||
#[error("{}", get_message("nohup-error-cannot-detach"))]
|
||||
CannotDetach,
|
||||
|
||||
#[error("{}", get_message_with_args("nohup-error-cannot-replace", HashMap::from([("name".to_string(), _0.to_string()), ("err".to_string(), _1.to_string())])))]
|
||||
#[error("{}", get_message_with_args("nohup-error-cannot-replace", HashMap::from([("name".to_string(), (*_0).to_string()), ("err".to_string(), _1.to_string())])))]
|
||||
CannotReplace(&'static str, #[source] Error),
|
||||
|
||||
#[error("{}", get_message_with_args("nohup-error-open-failed", HashMap::from([("path".to_string(), NOHUP_OUT.quote().to_string()), ("err".to_string(), _1.to_string())])))]
|
||||
|
|
|
@ -330,7 +330,7 @@ fn parse_type_string(params: &str) -> Result<Vec<ParsedFormatterItemInfo>, Strin
|
|||
|
||||
#[cfg(test)]
|
||||
pub fn parse_format_flags_str(args_str: &[&'static str]) -> Result<Vec<FormatterItemInfo>, String> {
|
||||
let args: Vec<String> = args_str.iter().map(|s| s.to_string()).collect();
|
||||
let args: Vec<String> = args_str.iter().map(|s| (*s).to_string()).collect();
|
||||
parse_format_flags(&args).map(|v| {
|
||||
// tests using this function assume add_ascii_dump is not set
|
||||
v.into_iter()
|
||||
|
|
|
@ -198,7 +198,7 @@ enum PtxError {
|
|||
#[error("{}", get_message("ptx-error-dumb-format"))]
|
||||
DumbFormat,
|
||||
|
||||
#[error("{}", get_message_with_args("ptx-error-not-implemented", HashMap::from([("feature".to_string(), .0.to_string())])))]
|
||||
#[error("{}", get_message_with_args("ptx-error-not-implemented", HashMap::from([("feature".to_string(), (*.0).to_string())])))]
|
||||
NotImplemented(&'static str),
|
||||
|
||||
#[error("{0}")]
|
||||
|
|
|
@ -270,7 +270,7 @@ fn stty(opts: &Options) -> UResult<()> {
|
|||
1,
|
||||
get_message_with_args(
|
||||
"stty-error-missing-argument",
|
||||
HashMap::from([("arg".to_string(), arg.to_string())]),
|
||||
HashMap::from([("arg".to_string(), (*arg).to_string())]),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
@ -286,8 +286,8 @@ fn stty(opts: &Options) -> UResult<()> {
|
|||
get_message_with_args(
|
||||
"stty-error-invalid-speed",
|
||||
HashMap::from([
|
||||
("arg".to_string(), arg.to_string()),
|
||||
("speed".to_string(), speed.to_string()),
|
||||
("arg".to_string(), (*arg).to_string()),
|
||||
("speed".to_string(), (*speed).to_string()),
|
||||
]),
|
||||
),
|
||||
));
|
||||
|
@ -298,7 +298,7 @@ fn stty(opts: &Options) -> UResult<()> {
|
|||
1,
|
||||
get_message_with_args(
|
||||
"stty-error-missing-argument",
|
||||
HashMap::from([("arg".to_string(), arg.to_string())]),
|
||||
HashMap::from([("arg".to_string(), (*arg).to_string())]),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ fn stty(opts: &Options) -> UResult<()> {
|
|||
1,
|
||||
get_message_with_args(
|
||||
"stty-error-invalid-argument",
|
||||
HashMap::from([("arg".to_string(), arg.to_string())]),
|
||||
HashMap::from([("arg".to_string(), (*arg).to_string())]),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ fn stty(opts: &Options) -> UResult<()> {
|
|||
1,
|
||||
get_message_with_args(
|
||||
"stty-error-missing-argument",
|
||||
HashMap::from([("arg".to_string(), arg.to_string())]),
|
||||
HashMap::from([("arg".to_string(), (*arg).to_string())]),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ fn stty(opts: &Options) -> UResult<()> {
|
|||
1,
|
||||
get_message_with_args(
|
||||
"stty-error-missing-argument",
|
||||
HashMap::from([("arg".to_string(), arg.to_string())]),
|
||||
HashMap::from([("arg".to_string(), (*arg).to_string())]),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
@ -433,7 +433,7 @@ fn stty(opts: &Options) -> UResult<()> {
|
|||
1,
|
||||
get_message_with_args(
|
||||
"stty-error-invalid-argument",
|
||||
HashMap::from([("arg".to_string(), arg.to_string())]),
|
||||
HashMap::from([("arg".to_string(), (*arg).to_string())]),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
@ -540,7 +540,7 @@ fn print_terminal_size(termios: &Termios, opts: &Options) -> nix::Result<()> {
|
|||
"{} ",
|
||||
get_message_with_args(
|
||||
"stty-output-speed",
|
||||
HashMap::from([("speed".to_string(), text.to_string())])
|
||||
HashMap::from([("speed".to_string(), (*text).to_string())])
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue