From 65b2f85475abefa767d7cd8d3d53087f668aa30f Mon Sep 17 00:00:00 2001 From: Tomek Karwowski Date: Mon, 3 Jul 2023 23:32:35 +0200 Subject: [PATCH] chore: fix clippy warning when running 'make test_others' --- courses/dss/labrpc/src/lib.rs | 2 +- courses/dss/raft/src/kvraft/config.rs | 12 ++++++------ courses/dss/raft/src/raft/tests.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/courses/dss/labrpc/src/lib.rs b/courses/dss/labrpc/src/lib.rs index 4fa396add..f0c3e3589 100644 --- a/courses/dss/labrpc/src/lib.rs +++ b/courses/dss/labrpc/src/lib.rs @@ -417,7 +417,7 @@ pub mod tests { pool.spawn_ok(async move { let x = i + 100; // this call ought to return false. - let _ = cli.handler2(&JunkArgs { x }); + let _ = cli.handler2(&JunkArgs { x }).await; sender.send(true).unwrap(); }); } diff --git a/courses/dss/raft/src/kvraft/config.rs b/courses/dss/raft/src/kvraft/config.rs index c70dabc74..b5e8cd009 100644 --- a/courses/dss/raft/src/kvraft/config.rs +++ b/courses/dss/raft/src/kvraft/config.rs @@ -169,7 +169,7 @@ impl Config { pub fn connect_all(&self) { let servers = self.servers.lock().unwrap(); for i in 0..self.n { - self.connect(i, &self.all(), &*servers); + self.connect(i, &self.all(), &servers); } } @@ -178,12 +178,12 @@ impl Config { debug!("partition servers into: {:?} {:?}", p1, p2); let servers = self.servers.lock().unwrap(); for i in p1 { - self.disconnect(*i, p2, &*servers); - self.connect(*i, p1, &*servers); + self.disconnect(*i, p2, &servers); + self.connect(*i, p1, &servers); } for i in p2 { - self.disconnect(*i, p1, &*servers); - self.connect(*i, p2, &*servers); + self.disconnect(*i, p1, &servers); + self.connect(*i, p2, &servers); } } @@ -232,7 +232,7 @@ impl Config { /// Shutdown a server by isolating it pub fn shutdown_server(&self, i: usize) { let mut servers = self.servers.lock().unwrap(); - self.disconnect(i, &self.all(), &*servers); + self.disconnect(i, &self.all(), &servers); // disable client connections to the server. // it's important to do this before creating diff --git a/courses/dss/raft/src/raft/tests.rs b/courses/dss/raft/src/raft/tests.rs index e045691f7..e87b78402 100644 --- a/courses/dss/raft/src/raft/tests.rs +++ b/courses/dss/raft/src/raft/tests.rs @@ -846,7 +846,7 @@ fn test_figure_8_unreliable_2c() { if (random.gen::() % 1000) < 100 { let ms = random.gen::() % (RAFT_ELECTION_TIMEOUT.as_millis() as u64 / 2); - thread::sleep(Duration::from_millis(ms as u64)); + thread::sleep(Duration::from_millis(ms)); } else { let ms = random.gen::() % 13; thread::sleep(Duration::from_millis(ms));