From 68d8d47c62f9afb18306a3bbf9bffee98e3bf14f Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Fri, 27 Mar 2020 01:15:00 +0100 Subject: [PATCH] fix clippy warning --- asyncgit/src/lib.rs | 2 +- src/components/index.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/asyncgit/src/lib.rs b/asyncgit/src/lib.rs index 60dc40d8..45f9d726 100644 --- a/asyncgit/src/lib.rs +++ b/asyncgit/src/lib.rs @@ -32,7 +32,7 @@ pub enum AsyncNotification { } /// helper function to calculate the hash of an arbitrary type that implements the `Hash` trait -pub fn hash(v: &T) -> u64 { +pub fn hash(v: &T) -> u64 { let mut hasher = DefaultHasher::new(); v.hash(&mut hasher); hasher.finish() diff --git a/src/components/index.rs b/src/components/index.rs index a987742b..5f305223 100644 --- a/src/components/index.rs +++ b/src/components/index.rs @@ -36,9 +36,9 @@ impl IndexComponent { } /// - pub fn update(&mut self, list: &Vec) { + pub fn update(&mut self, list: &[StatusItem]) { if hash(&self.items) != hash(list) { - self.items = list.clone(); + self.items = list.to_owned(); let old_selection = self.selection.unwrap_or_default(); self.selection = if self.items.is_empty() {