diff --git a/protocols/kad/CHANGELOG.md b/protocols/kad/CHANGELOG.md index 4284ca5bf6d..9504673b972 100644 --- a/protocols/kad/CHANGELOG.md +++ b/protocols/kad/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.22.1 [2020-08-19] + +- Explicitly convert from u8 to usize in `BucketIndex::range` to prevent type + inference issues ([PR 1716](https://github.com/libp2p/rust-libp2p/pull/1716)). + # 0.22.0 [2020-08-18] - Store addresses in provider records. diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index fb5d47ed950..eb60d59089f 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-kad" edition = "2018" description = "Kademlia protocol for libp2p" -version = "0.22.0" +version = "0.22.1" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/protocols/kad/src/kbucket.rs b/protocols/kad/src/kbucket.rs index 3de74fad6bf..6ab7e27af6a 100644 --- a/protocols/kad/src/kbucket.rs +++ b/protocols/kad/src/kbucket.rs @@ -120,7 +120,7 @@ impl BucketIndex { /// included in the bucket for this index. fn range(&self) -> (Distance, Distance) { let min = Distance(U256::pow(U256::from(2), U256::from(self.0))); - if self.0 == u8::MAX.into() { + if self.0 == usize::from(u8::MAX) { (min, Distance(U256::MAX)) } else { let max = Distance(U256::pow(U256::from(2), U256::from(self.0 + 1)) - 1);