diff --git a/contrib/bencode/src/access/dict.rs b/contrib/bencode/src/access/dict.rs index 596d9535..7efe93fc 100644 --- a/contrib/bencode/src/access/dict.rs +++ b/contrib/bencode/src/access/dict.rs @@ -21,6 +21,7 @@ pub trait BDictAccess { impl<'a, V> BDictAccess<&'a [u8], V> for BTreeMap<&'a [u8], V> { fn to_list(&self) -> Vec<(&&'a [u8], &V)> { + #[allow(clippy::map_identity)] self.iter().map(|(k, v)| (k, v)).collect() } @@ -43,6 +44,7 @@ impl<'a, V> BDictAccess<&'a [u8], V> for BTreeMap<&'a [u8], V> { impl<'a, V> BDictAccess, V> for BTreeMap, V> { fn to_list(&self) -> Vec<(&Cow<'a, [u8]>, &V)> { + #[allow(clippy::map_identity)] self.iter().map(|(k, v)| (k, v)).collect() } diff --git a/src/servers/udp/connection_cookie.rs b/src/servers/udp/connection_cookie.rs index 4dc9896a..19e61f14 100644 --- a/src/servers/udp/connection_cookie.rs +++ b/src/servers/udp/connection_cookie.rs @@ -173,11 +173,12 @@ mod tests { #[test] fn it_should_make_a_connection_cookie() { // Note: This constant may need to be updated in the future as the hash is not guaranteed to to be stable between versions. - const ID_COOKIE: Cookie = [23, 204, 198, 29, 48, 180, 62, 19]; + const ID_COOKIE_OLD: Cookie = [23, 204, 198, 29, 48, 180, 62, 19]; + const ID_COOKIE_NEW: Cookie = [41, 166, 45, 246, 249, 24, 108, 203]; let cookie = make(&SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), 0)); - assert_eq!(cookie, ID_COOKIE); + assert!(cookie == ID_COOKIE_OLD || cookie == ID_COOKIE_NEW); } #[test]