Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy warnings #2620

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hash/src/pbkdf2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn compute_pbkdf2_sha512(
derived_key_length: usize,
) -> Result<Vec<u8>, Pbkdf2Error> {
// Following https://www.ietf.org/rfc/rfc2898.txt
if (derived_key_length as u64) > u64::from(u32::max_value()) * (Sha512Hash::len() as u64) {
if (derived_key_length as u64) > u64::from(u32::MAX) * (Sha512Hash::len() as u64) {
return Err(Pbkdf2Error::KeyTooLong);
}

Expand Down
6 changes: 2 additions & 4 deletions network-libp2p/src/connection_pool/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ impl<T> std::fmt::Display for ConnectionState<T> {
#[derive(Debug)]
pub enum Event {
/// A peer has joined
PeerJoined { peer_id: PeerId },
PeerJoined,
}

type PoolToSwarm = ToSwarm<Event, Void>;
Expand Down Expand Up @@ -677,9 +677,7 @@ impl Behaviour {
.mark_connected(address.clone(), peer_services);

self.actions
.push_back(ToSwarm::GenerateEvent(Event::PeerJoined {
peer_id: *peer_id,
}));
.push_back(ToSwarm::GenerateEvent(Event::PeerJoined));
self.wake();

self.maintain_peers();
Expand Down
2 changes: 1 addition & 1 deletion network-libp2p/src/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ fn handle_event(
}
behaviour::BehaviourEvent::Pool(event) => {
match event {
connection_pool::Event::PeerJoined { peer_id: _ } => {}
connection_pool::Event::PeerJoined => {}
};
}
behaviour::BehaviourEvent::RequestResponse(event) => match event {
Expand Down
2 changes: 1 addition & 1 deletion primitives/src/key_nibbles.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{
cmp::{self, Ordering},
fmt, io, ops, str, usize,
fmt, io, ops, str,
};

use byteorder::WriteBytesExt;
Expand Down
Loading