*: Fix newly raised clippy warnings (#3106)

Fixed minor issues raised by clippy to improve correctness and readablitity.
This commit is contained in:
Hannes
2022-11-11 21:30:58 +01:00
committed by GitHub
parent 90df86d9e7
commit c32f03c317
20 changed files with 51 additions and 53 deletions

View File

@ -53,7 +53,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
// Create a random PeerId
let id_keys = identity::Keypair::generate_ed25519();
let peer_id = PeerId::from(id_keys.public());
println!("Local peer id: {:?}", peer_id);
println!("Local peer id: {peer_id:?}");
// Create a tokio-based TCP transport use noise for authenticated
// encryption and Mplex for multiplexing of substreams on a TCP stream.
@ -119,7 +119,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
if let Some(to_dial) = std::env::args().nth(1) {
let addr: Multiaddr = to_dial.parse()?;
swarm.dial(addr)?;
println!("Dialed {:?}", to_dial);
println!("Dialed {to_dial:?}");
}
// Read full lines from stdin
@ -138,7 +138,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
event = swarm.select_next_some() => {
match event {
SwarmEvent::NewListenAddr { address, .. } => {
println!("Listening on {:?}", address);
println!("Listening on {address:?}");
}
SwarmEvent::Behaviour(MyBehaviourEvent::Floodsub(FloodsubEvent::Message(message))) => {
println!(