From 3ca0820ff5d47f948b8509185a058bdf58d336c2 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Sun, 11 Feb 2024 23:57:37 +0000 Subject: [PATCH] Fix clippy warnings --- src/map.rs | 4 ++-- src/set.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/map.rs b/src/map.rs index 9cd768f20..d7b456034 100644 --- a/src/map.rs +++ b/src/map.rs @@ -6805,7 +6805,7 @@ mod test_map { assert_eq!(m2.len(), 2); } - thread_local! { static DROP_VECTOR: RefCell> = RefCell::new(Vec::new()) } + thread_local! { static DROP_VECTOR: RefCell> = const { RefCell::new(Vec::new()) } } #[derive(Hash, PartialEq, Eq)] struct Droppable { @@ -8524,7 +8524,7 @@ mod test_map { #[test] #[should_panic = "panic in clone"] fn test_clone_from_memory_leaks() { - use ::alloc::vec::Vec; + use alloc::vec::Vec; struct CheckedClone { panic_in_clone: bool, diff --git a/src/set.rs b/src/set.rs index fdff46d88..c16948e3b 100644 --- a/src/set.rs +++ b/src/set.rs @@ -2820,7 +2820,7 @@ mod test_set { assert_eq!(last_i, 49); } - for _ in &s { + if !s.is_empty() { panic!("s should be empty!"); } @@ -2834,6 +2834,7 @@ mod test_set { use core::hash; #[derive(Debug)] + #[allow(dead_code)] struct Foo(&'static str, i32); impl PartialEq for Foo {