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() {