diff --git a/src/lib.rs b/src/lib.rs index 97277ca..14f895d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -92,10 +92,6 @@ struct KeyRef { } impl Hash for KeyRef { - // NB: The unconditional_recursion lint was added in 1.76.0 and can be removed - // once the current stable version of Rust is 1.76.0 or higher. - #![allow(unknown_lints)] - #[allow(clippy::unconditional_recursion)] fn hash(&self, state: &mut H) { unsafe { (*self.k).hash(state) } } @@ -103,7 +99,13 @@ impl Hash for KeyRef { impl PartialEq for KeyRef { fn eq(&self, other: &KeyRef) -> bool { - unsafe { (*self.k).eq(&*other.k) } + // NB: The unconditional_recursion lint was added in 1.76.0 and can be removed + // once the current stable version of Rust is 1.76.0 or higher. + #![allow(unknown_lints)] + #[allow(clippy::unconditional_recursion)] + unsafe { + (*self.k).eq(&*other.k) + } } }