mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-24 23:31:33 +00:00
chore: Implement latest clippy warnings (#3220)
As I do frequently, I corrected for the latest clippy warnings. This will make sure the CI won't complain in the future. We could automate this btw and maybe run the nightly version of clippy.
This commit is contained in:
@ -47,7 +47,7 @@ use std::error::Error;
|
||||
async fn main() -> Result<(), Box<dyn Error>> {
|
||||
let local_key = identity::Keypair::generate_ed25519();
|
||||
let local_peer_id = PeerId::from(local_key.public());
|
||||
println!("Local peer id: {:?}", local_peer_id);
|
||||
println!("Local peer id: {local_peer_id:?}");
|
||||
|
||||
let transport = libp2p_tcp::async_io::Transport::default()
|
||||
.upgrade(Version::V1)
|
||||
@ -72,19 +72,19 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
if let Some(addr) = std::env::args().nth(1) {
|
||||
let remote: Multiaddr = addr.parse()?;
|
||||
swarm.dial(remote)?;
|
||||
println!("Dialed {}", addr)
|
||||
println!("Dialed {addr}")
|
||||
}
|
||||
|
||||
loop {
|
||||
match swarm.select_next_some().await {
|
||||
SwarmEvent::NewListenAddr { address, .. } => println!("Listening on {:?}", address),
|
||||
SwarmEvent::NewListenAddr { address, .. } => println!("Listening on {address:?}"),
|
||||
// Prints peer id identify info is being sent to.
|
||||
SwarmEvent::Behaviour(identify::Event::Sent { peer_id, .. }) => {
|
||||
println!("Sent identify info to {:?}", peer_id)
|
||||
println!("Sent identify info to {peer_id:?}")
|
||||
}
|
||||
// Prints out the info received via the identify event
|
||||
SwarmEvent::Behaviour(identify::Event::Received { info, .. }) => {
|
||||
println!("Received {:?}", info)
|
||||
println!("Received {info:?}")
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user