From d359fabe7b85bc6966172bb8c047f3fb345fdff0 Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Thu, 30 Sep 2021 23:30:39 +0200 Subject: [PATCH] clippy fixes --- filetreelist/src/item.rs | 2 +- src/components/externaleditor.rs | 2 +- src/main.rs | 4 ++-- src/tabs/status.rs | 4 +--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/filetreelist/src/item.rs b/filetreelist/src/item.rs index 68f91d95..cc6a7571 100644 --- a/filetreelist/src/item.rs +++ b/filetreelist/src/item.rs @@ -63,7 +63,7 @@ impl TreeItemInfo { .unwrap_or_default(), ) }, - |folding| folding.as_path(), + PathBuf::as_path, ) } diff --git a/src/components/externaleditor.rs b/src/components/externaleditor.rs index e504690f..0e67949a 100644 --- a/src/components/externaleditor.rs +++ b/src/components/externaleditor.rs @@ -104,7 +104,7 @@ impl ExternalEditorComponent { let remainder = remainder_str.split_whitespace(); let mut args: Vec<&OsStr> = - remainder.map(|s| OsStr::new(s)).collect(); + remainder.map(OsStr::new).collect(); args.push(path.as_os_str()); diff --git a/src/main.rs b/src/main.rs index fb272fca..e9a50418 100644 --- a/src/main.rs +++ b/src/main.rs @@ -229,8 +229,8 @@ fn draw( terminal.resize(terminal.size()?)?; } - terminal.draw(|mut f| { - if let Err(e) = app.draw(&mut f) { + terminal.draw(|f| { + if let Err(e) = app.draw(f) { log::error!("failed to draw: {:?}", e); } })?; diff --git a/src/tabs/status.rs b/src/tabs/status.rs index 51606bb0..9b4890f8 100644 --- a/src/tabs/status.rs +++ b/src/tabs/status.rs @@ -224,9 +224,7 @@ impl Status { let ids = format!( "({})", ids.iter() - .map(|id| sync::CommitId::get_short_string( - id - )) + .map(sync::CommitId::get_short_string) .join(",") );