mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 05:06:11 +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
@@ -19,9 +19,7 @@ async fn aws_creds(aws_config: &SdkConfig) -> Result<Option<Credentials>, ShellE
|
||||
error: format!(
|
||||
"Could not fetch AWS credentials: {} - {}",
|
||||
e,
|
||||
e.source()
|
||||
.map(|e| format!("{}", e))
|
||||
.unwrap_or("".to_string())
|
||||
e.source().map(|e| format!("{e}")).unwrap_or("".to_string())
|
||||
),
|
||||
msg: "".into(),
|
||||
span: None,
|
||||
|
@@ -97,7 +97,7 @@ fn dataframe_command(
|
||||
input: Value,
|
||||
) -> Result<PipelineData, ShellError> {
|
||||
let df = NuDataFrame::try_from_value_coerce(plugin, &input, call.head)?;
|
||||
let value = Value::string(format!("{}", df), call.head);
|
||||
let value = Value::string(format!("{df}"), call.head);
|
||||
Ok(PipelineData::Value(value, None))
|
||||
}
|
||||
|
||||
|
@@ -64,14 +64,14 @@ pub(crate) fn datetime_commands() -> Vec<Box<dyn PluginCommand<Plugin = PolarsPl
|
||||
pub fn timezone_from_str(zone_str: &str, span: Option<Span>) -> Result<TimeZone, ShellError> {
|
||||
TimeZone::opt_try_new(Some(PlSmallStr::from_str(zone_str)))
|
||||
.map_err(|e| ShellError::GenericError {
|
||||
error: format!("Invalid timezone: {} : {}", zone_str, e),
|
||||
error: format!("Invalid timezone: {zone_str} : {e}"),
|
||||
msg: "".into(),
|
||||
span,
|
||||
help: None,
|
||||
inner: vec![],
|
||||
})?
|
||||
.ok_or(ShellError::GenericError {
|
||||
error: format!("Invalid timezone {}", zone_str),
|
||||
error: format!("Invalid timezone {zone_str}"),
|
||||
msg: "".into(),
|
||||
span,
|
||||
help: None,
|
||||
|
@@ -14,7 +14,7 @@ fn main() {
|
||||
match PolarsPlugin::new() {
|
||||
Ok(ref plugin) => serve_plugin(plugin, MsgPackSerializer {}),
|
||||
Err(e) => {
|
||||
eprintln!("{}", e);
|
||||
eprintln!("{e}");
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user