diff --git a/src/id.rs b/src/id.rs index 098bcabc2..4546b116f 100644 --- a/src/id.rs +++ b/src/id.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Daniel Mueller (deso@posteo.net) +// Copyright (C) 2022-2023 Daniel Mueller (deso@posteo.net) // SPDX-License-Identifier: GPL-3.0-or-later use std::cmp::Ordering; @@ -56,10 +56,7 @@ impl Id { impl Clone for Id { fn clone(&self) -> Self { - Self { - id: self.id, - _phantom: PhantomData, - } + *self } } diff --git a/src/ui/tab_bar.rs b/src/ui/tab_bar.rs index c3a13f1cb..701132403 100644 --- a/src/ui/tab_bar.rs +++ b/src/ui/tab_bar.rs @@ -600,37 +600,37 @@ mod tests { #[test] fn search_tabs() { - let tabs = vec![1, 2, 3]; + let tabs = [1, 2, 3]; let selected = 0; let reverse = false; let snapshot = search_snapshot(tabs.iter().copied(), selected, reverse); assert_eq!(snapshot, vec![1, 2, 3, 1]); - let tabs = vec![1, 2, 3, 4]; + let tabs = [1, 2, 3, 4]; let selected = 1; let reverse = false; let snapshot = search_snapshot(tabs.iter().copied(), selected, reverse); assert_eq!(snapshot, vec![2, 3, 4, 1, 2]); - let tabs = vec![1, 2, 3]; + let tabs = [1, 2, 3]; let selected = 2; let reverse = false; let snapshot = search_snapshot(tabs.iter().copied(), selected, reverse); assert_eq!(snapshot, vec![3, 1, 2, 3]); - let tabs = vec![1, 2, 3]; + let tabs = [1, 2, 3]; let selected = 0; let reverse = true; let snapshot = search_snapshot(tabs.iter().copied(), selected, reverse); assert_eq!(snapshot, vec![1, 3, 2, 1]); - let tabs = vec![1, 2, 3, 4, 5]; + let tabs = [1, 2, 3, 4, 5]; let selected = 1; let reverse = true; let snapshot = search_snapshot(tabs.iter().copied(), selected, reverse); assert_eq!(snapshot, vec![2, 1, 5, 4, 3, 2]); - let tabs = vec![1, 2, 3]; + let tabs = [1, 2, 3]; let selected = 2; let reverse = true; let snapshot = search_snapshot(tabs.iter().copied(), selected, reverse);