Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Automation authored and dav1do committed May 13, 2024
1 parent ec0470c commit 95d2eda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
4 changes: 2 additions & 2 deletions recon/src/libp2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ use libp2p::{
swarm::{ConnectionId, NetworkBehaviour, NotifyHandler, ToSwarm},
};
use libp2p_identity::PeerId;
use std::collections::VecDeque;
use std::task::Waker;
use std::{
collections::{btree_map::Entry, BTreeMap},
task::Poll,
time::{Duration, Instant},
};
use std::collections::VecDeque;
use std::task::Waker;
use tracing::{debug, trace, warn};

pub use crate::protocol::Recon;
Expand Down
16 changes: 4 additions & 12 deletions recon/src/libp2p/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,7 @@ mod loomtest {
MockReconForEventId::new(),
Config::default(),
);
let res = loom::future::block_on(poll_immediate(poll_fn(|cx| {
behavior.poll(cx)
})));
let res = loom::future::block_on(poll_immediate(poll_fn(|cx| behavior.poll(cx))));
assert!(res.is_none())
});
}
Expand All @@ -239,9 +237,7 @@ mod loomtest {
last_sync: None,
},
);
let res = loom::future::block_on(poll_immediate(poll_fn(|cx| {
behavior.poll(cx)
})));
let res = loom::future::block_on(poll_immediate(poll_fn(|cx| behavior.poll(cx))));
assert!(res.is_none());
});
}
Expand All @@ -255,19 +251,15 @@ mod loomtest {
Config::default(),
);
let mut behavior = std::pin::Pin::new(&mut behavior);
let res = loom::future::block_on(poll_immediate(poll_fn(|cx| {
behavior.poll(cx)
})));
let res = loom::future::block_on(poll_immediate(poll_fn(|cx| behavior.poll(cx))));
assert!(res.is_none());

behavior.send_event(ToSwarm::GenerateEvent(Event::PeerEvent(PeerEvent {
remote_peer_id: PEER_ID.parse().unwrap(),
status: PeerStatus::Waiting,
})));

let res = loom::future::block_on(poll_immediate(poll_fn(|cx| {
behavior.poll(cx)
})));
let res = loom::future::block_on(poll_immediate(poll_fn(|cx| behavior.poll(cx))));

assert!(res.is_some());
});
Expand Down

0 comments on commit 95d2eda

Please sign in to comment.