mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 17:08:21 +00:00
fix clippy warning
This commit is contained in:
parent
8e7d2eb4a1
commit
68d8d47c62
2 changed files with 3 additions and 3 deletions
|
|
@ -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<T: Hash>(v: &T) -> u64 {
|
||||
pub fn hash<T: Hash + ?Sized>(v: &T) -> u64 {
|
||||
let mut hasher = DefaultHasher::new();
|
||||
v.hash(&mut hasher);
|
||||
hasher.finish()
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ impl IndexComponent {
|
|||
}
|
||||
|
||||
///
|
||||
pub fn update(&mut self, list: &Vec<StatusItem>) {
|
||||
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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue