diff options
Diffstat (limited to 'src/collection')
| -rw-r--r-- | src/collection/ref_collection.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/collection/ref_collection.rs b/src/collection/ref_collection.rs index 2462182..41f6b16 100644 --- a/src/collection/ref_collection.rs +++ b/src/collection/ref_collection.rs @@ -15,9 +15,8 @@ fn get_locks<L: Lockable>(data: &L) -> Vec<&dyn Lock> { /// returns `true` if the sorted list contains a duplicate #[must_use] fn contains_duplicates(l: &[&dyn Lock]) -> bool { - l.windows(2).any(|window| { - std::ptr::addr_eq(std::ptr::from_ref(window[0]), std::ptr::from_ref(window[1])) - }) + l.windows(2) + .any(|window| std::ptr::eq(window[0], window[1])) } impl<'a, L: Lockable> AsRef<L> for RefLockCollection<'a, L> { |
