mirror of
https://github.com/nushell/nushell.git
synced 2025-08-11 13:34:49 +02:00
Fix easy clippy lints from latest stable (#16053)
1.88.0 was released today, clippy now lints (machine-applicable) against: - format strings with empty braces that could be inlined - easy win - `manual_abs_diff` - returning of a stored result of the last expression. - this can be somewhat contentious but touched only a few places
This commit is contained in:
committed by
GitHub
parent
372d576846
commit
9da0f41ebb
@ -42,14 +42,14 @@ impl SimplePluginCommand for IntoPlist {
|
||||
let mut out = Vec::new();
|
||||
if call.has_flag("binary")? {
|
||||
plist::to_writer_binary(&mut out, &plist_val)
|
||||
.map_err(|e| build_label_error(format!("{}", e), input.span()))?;
|
||||
.map_err(|e| build_label_error(format!("{e}"), input.span()))?;
|
||||
Ok(NuValue::binary(out, input.span()))
|
||||
} else {
|
||||
plist::to_writer_xml(&mut out, &plist_val)
|
||||
.map_err(|e| build_label_error(format!("{}", e), input.span()))?;
|
||||
.map_err(|e| build_label_error(format!("{e}"), input.span()))?;
|
||||
Ok(NuValue::string(
|
||||
String::from_utf8(out)
|
||||
.map_err(|e| build_label_error(format!("{}", e), input.span()))?,
|
||||
.map_err(|e| build_label_error(format!("{e}"), input.span()))?,
|
||||
input.span(),
|
||||
))
|
||||
}
|
||||
@ -77,7 +77,7 @@ fn convert_nu_value(nu_val: &NuValue) -> Result<PlistValue, LabeledError> {
|
||||
NuValue::Date { val, .. } => Ok(PlistValue::Date(SystemTime::from(val.to_owned()).into())),
|
||||
NuValue::Filesize { val, .. } => Ok(PlistValue::Integer(val.get().into())),
|
||||
_ => Err(build_label_error(
|
||||
format!("{:?} is not convertible", nu_val),
|
||||
format!("{nu_val:?} is not convertible"),
|
||||
span,
|
||||
)),
|
||||
}
|
||||
|
Reference in New Issue
Block a user