mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-01-22 10:44:36 +00:00
clippy
This commit is contained in:
parent
1c72c0952f
commit
b4a2be2338
5 changed files with 7 additions and 8 deletions
|
@ -87,7 +87,7 @@ fn peer_list_remove_specific_peer() {
|
|||
let mut peer_list = make_fake_peer_list_with_random_pruning_seeds(100);
|
||||
|
||||
let peer = peer_list
|
||||
.take_random_peer(&mut rand::thread_rng(), None)
|
||||
.take_random_peer(&mut rand::thread_rng(), None, &HashSet::new())
|
||||
.unwrap();
|
||||
|
||||
let pruning_idxs = peer_list.pruning_seeds;
|
||||
|
@ -160,7 +160,7 @@ fn peer_list_get_peer_with_block() {
|
|||
peer_list.add_new_peer(make_fake_peer(101, Some(384)));
|
||||
|
||||
let peer = peer_list
|
||||
.take_random_peer(&mut r, Some(1))
|
||||
.take_random_peer(&mut r, Some(1), &HashSet::new())
|
||||
.expect("We just added a peer with the correct seed");
|
||||
|
||||
assert!(peer
|
||||
|
@ -173,7 +173,7 @@ fn peer_list_get_peer_with_block() {
|
|||
fn peer_list_ban_peers() {
|
||||
let mut peer_list = make_fake_peer_list_with_random_pruning_seeds(100);
|
||||
let peer = peer_list
|
||||
.take_random_peer(&mut rand::thread_rng(), None)
|
||||
.take_random_peer(&mut rand::thread_rng(), None, &HashSet::new())
|
||||
.unwrap();
|
||||
let ban_id = peer.adr.ban_id();
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::{
|
|||
task::{ready, Context, Poll},
|
||||
};
|
||||
|
||||
use futures::{channel::oneshot, FutureExt};
|
||||
use futures::channel::oneshot;
|
||||
use tokio::{
|
||||
sync::{mpsc, OwnedSemaphorePermit, Semaphore},
|
||||
task::JoinHandle,
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
//! This module handles routing requests from a [`Client`](crate::client::Client) or a broadcast channel to
|
||||
//! a peer. This module also handles routing requests from the connected peer to a request handler.
|
||||
//!
|
||||
use std::{pin::Pin, sync::Arc, time::Duration};
|
||||
use std::pin::Pin;
|
||||
|
||||
use futures::{
|
||||
channel::oneshot,
|
||||
lock::{Mutex, OwnedMutexGuard},
|
||||
stream::{Fuse, FusedStream},
|
||||
SinkExt, Stream, StreamExt,
|
||||
};
|
||||
|
|
|
@ -475,7 +475,7 @@ where
|
|||
id: addr,
|
||||
handle,
|
||||
direction,
|
||||
pruning_seed: pruning_seed.clone(),
|
||||
pruning_seed,
|
||||
};
|
||||
|
||||
let semaphore = Arc::new(Semaphore::new(1));
|
||||
|
|
|
@ -107,7 +107,7 @@ async fn handshake_cuprate_to_cuprate() {
|
|||
.unwrap()
|
||||
});
|
||||
|
||||
let (res1, res2) = futures::join!(p1, p2);
|
||||
let (res1, res2) = tokio::join!(p1, p2);
|
||||
res1.unwrap();
|
||||
res2.unwrap();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue