Clippy fixes for Rust 1.58 (#733)

* Clippy fixes for Rust 1.58

* Try different message
This commit is contained in:
JT
2022-01-14 06:40:25 +11:00
committed by GitHub
parent 1ecbebb24a
commit bc1e1aa944
11 changed files with 11 additions and 19 deletions

View File

@ -389,7 +389,7 @@ Format: #
"attr" => nu_style.attr = Some(v.as_string()?),
_ => {
return Err(ShellError::IncompatibleParametersSingle(
format!("problem with key: {}", k.to_string()),
format!("problem with key: {}", k),
code.span().expect("error with span"),
))
}

View File

@ -275,7 +275,7 @@ fn action(
}
}
other => {
let got = format!("value is {}, not string", other.get_type().to_string());
let got = format!("value is {}, not string", other.get_type());
Value::Error {
error: ShellError::TypeMismatch(got, other.span().unwrap_or(*command_span)),

View File

@ -90,7 +90,7 @@ fn action(input: &Value, command_span: &Span) -> Value {
Value::string(stripped_string, *span)
}
other => {
let got = format!("value is {}, not string", other.get_type().to_string());
let got = format!("value is {}, not string", other.get_type());
Value::Error {
error: ShellError::TypeMismatch(got, other.span().unwrap_or(*command_span)),

View File

@ -111,7 +111,7 @@ impl Command for Kill {
}
cmd.arg("-9");
} else if let Some(signal_value) = signal {
cmd.arg(format!("-{}", signal_value.item.to_string()));
cmd.arg(format!("-{}", signal_value.item));
}
cmd.arg(pid.to_string());