mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-08-01 01:11:58 +00:00
*: Fix clippy warnings (#2139)
* Fix needless question mark operator * Don't convert from u64 to u64 LocalStreamId is already a u64, no need to convert. * Don't use `.into()` to convert to the same type * Don't specify lifetime if it can be inferred * Use `vec!` macro if we immediately push to it This creates the vector with the appropriate capacity. * Don't index array when taking a reference is enough Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
@@ -186,7 +186,7 @@ where
|
||||
///
|
||||
/// The buckets are ordered by proximity to the `local_key`, i.e. the first
|
||||
/// bucket is the closest bucket (containing at most one key).
|
||||
pub fn iter<'a>(&'a mut self) -> impl Iterator<Item = KBucketRef<'a, TKey, TVal>> + 'a {
|
||||
pub fn iter(&mut self) -> impl Iterator<Item = KBucketRef<'_, TKey, TVal>> + '_ {
|
||||
let applied_pending = &mut self.applied_pending;
|
||||
self.buckets.iter_mut().enumerate().map(move |(i, b)| {
|
||||
if let Some(applied) = b.apply_pending() {
|
||||
|
Reference in New Issue
Block a user