From f2b09d39c6b4eed3c545d012774f8ac1ce028553 Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Sun, 30 Jan 2022 19:28:45 +0100 Subject: [PATCH] clippy nightly fixes --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- asyncgit/Cargo.toml | 2 +- asyncgit/src/sync/tree.rs | 8 ++++---- filetreelist/Cargo.toml | 2 +- filetreelist/src/filetreeitems.rs | 2 +- src/components/mod.rs | 3 +++ 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ab5d3fc5..b5cb8d3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,7 +63,7 @@ dependencies = [ [[package]] name = "asyncgit" -version = "0.20.1" +version = "0.21.0" dependencies = [ "crossbeam-channel", "easy-cast", @@ -385,7 +385,7 @@ dependencies = [ [[package]] name = "filetreelist" -version = "0.4.0" +version = "0.5.0" dependencies = [ "pretty_assertions", "scopetime", diff --git a/Cargo.toml b/Cargo.toml index a40f4b80..df12fda3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ keywords = [ [dependencies] anyhow = "1.0" -asyncgit = { path = "./asyncgit", version = "0.20", default-features = false } +asyncgit = { path = "./asyncgit", version = "0.21", default-features = false } backtrace = "0.3" bitflags = "1.3" bugreport = "0.4" @@ -32,7 +32,7 @@ crossbeam-channel = "0.5" crossterm = { version = "0.20", features = [ "serde" ] } dirs-next = "2.0" easy-cast = "0.4" -filetreelist = { path = "./filetreelist", version = "0.4" } +filetreelist = { path = "./filetreelist", version = "0.5" } fuzzy-matcher = "0.3" gh-emoji = { version = "1.0", optional = true } itertools = "0.10" diff --git a/asyncgit/Cargo.toml b/asyncgit/Cargo.toml index 96c9fe53..f18eb52a 100644 --- a/asyncgit/Cargo.toml +++ b/asyncgit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "asyncgit" -version = "0.20.1" +version = "0.21.0" authors = ["Stephan Dilly "] edition = "2018" description = "allow using git2 in a asynchronous context" diff --git a/asyncgit/src/sync/tree.rs b/asyncgit/src/sync/tree.rs index d13d7064..1b4499d7 100644 --- a/asyncgit/src/sync/tree.rs +++ b/asyncgit/src/sync/tree.rs @@ -42,7 +42,7 @@ pub fn tree_files( Ok(files) } -fn sort_file_list(files: &mut Vec) { +fn sort_file_list(files: &mut [TreeFile]) { files.sort_by(|a, b| path_cmp(&a.path, &b.path)); } @@ -163,7 +163,7 @@ mod tests { filemode: 0, id: Oid::zero(), }) - .collect(); + .collect::>(); sort_file_list(&mut list); @@ -188,7 +188,7 @@ mod tests { filemode: 0, id: Oid::zero(), }) - .collect(); + .collect::>(); sort_file_list(&mut list); @@ -212,7 +212,7 @@ mod tests { filemode: 0, id: Oid::zero(), }) - .collect(); + .collect::>(); sort_file_list(&mut list); diff --git a/filetreelist/Cargo.toml b/filetreelist/Cargo.toml index af6d75d0..17300ba1 100644 --- a/filetreelist/Cargo.toml +++ b/filetreelist/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "filetreelist" -version = "0.4.0" +version = "0.5.0" authors = ["Stephan Dilly "] edition = "2018" description = "filetree abstraction based on a sorted path list, supports key based navigation events, folding, scrolling and more" diff --git a/filetreelist/src/filetreeitems.rs b/filetreelist/src/filetreeitems.rs index a3857870..18c4bfd0 100644 --- a/filetreelist/src/filetreeitems.rs +++ b/filetreelist/src/filetreeitems.rs @@ -368,7 +368,7 @@ impl FileTreeItems { } fn unindent( - items: &mut Vec, + items: &mut [FileTreeItem], prefix: &str, start: usize, ) { diff --git a/src/components/mod.rs b/src/components/mod.rs index 35e07905..cce907f5 100644 --- a/src/components/mod.rs +++ b/src/components/mod.rs @@ -245,6 +245,9 @@ impl From for EventState { /// base component trait pub trait Component { /// + //TODO: remove once workaround for clippy bug: + // + #[allow(clippy::ptr_arg)] fn commands( &self, out: &mut Vec,