diff --git a/benches/benches.rs b/benches/benches.rs index 6b034e269..63ca57fa2 100644 --- a/benches/benches.rs +++ b/benches/benches.rs @@ -12,7 +12,6 @@ mod suites; pub const DEFAULT_RAFT_SETS: [(usize, usize); 4] = [(0, 0), (3, 1), (5, 2), (7, 3)]; fn main() { - criterion::init_logging(); let mut c = Criterion::default() // Configure defaults before overriding with args. .warm_up_time(Duration::from_millis(500)) diff --git a/src/lib.rs b/src/lib.rs index 412fca4cd..29707f0ec 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -261,7 +261,6 @@ For more information, check out an [example](examples/single_mem_node/main.rs#L1 */ #![cfg_attr(not(feature = "cargo-clippy"), allow(unknown_lints))] -#![cfg_attr(feature = "cargo-clippy", feature(tool_lints))] #![deny(missing_docs)] #[cfg(feature = "failpoint")] diff --git a/src/raft.rs b/src/raft.rs index abc8fb2c5..713f9a497 100644 --- a/src/raft.rs +++ b/src/raft.rs @@ -679,7 +679,7 @@ impl Raft { self.election_elapsed = 0; let m = new_message(INVALID_ID, MessageType::MsgHup, Some(self.id)); - self.step(m).is_ok(); + let _ = self.step(m); true } @@ -695,7 +695,7 @@ impl Raft { if self.check_quorum { let m = new_message(INVALID_ID, MessageType::MsgCheckQuorum, Some(self.id)); has_ready = true; - self.step(m).is_ok(); + let _ = self.step(m); } if self.state == StateRole::Leader && self.lead_transferee.is_some() { self.abort_leader_transfer() @@ -710,7 +710,7 @@ impl Raft { self.heartbeat_elapsed = 0; has_ready = true; let m = new_message(INVALID_ID, MessageType::MsgBeat, Some(self.id)); - self.step(m).is_ok(); + let _ = self.step(m); } has_ready } @@ -794,7 +794,7 @@ impl Raft { } fn num_pending_conf(&self, ents: &[Entry]) -> usize { - ents.into_iter() + ents.iter() .filter(|e| e.get_entry_type() == EntryType::EntryConfChange) .count() } diff --git a/src/raw_node.rs b/src/raw_node.rs index 94da81d85..350812b11 100644 --- a/src/raw_node.rs +++ b/src/raw_node.rs @@ -443,7 +443,7 @@ impl RawNode { m.set_msg_type(MessageType::MsgUnreachable); m.set_from(id); // we don't care if it is ok actually - self.raft.step(m).is_ok(); + let _ = self.raft.step(m); } /// ReportSnapshot reports the status of the sent snapshot. @@ -454,7 +454,7 @@ impl RawNode { m.set_from(id); m.set_reject(rej); // we don't care if it is ok actually - self.raft.step(m).is_ok(); + let _ = self.raft.step(m); } /// TransferLeader tries to transfer leadership to the given transferee. @@ -462,7 +462,7 @@ impl RawNode { let mut m = Message::new(); m.set_msg_type(MessageType::MsgTransferLeader); m.set_from(transferee); - self.raft.step(m).is_ok(); + let _ = self.raft.step(m); } /// ReadIndex requests a read state. The read state will be set in ready. @@ -475,7 +475,7 @@ impl RawNode { let mut e = Entry::new(); e.set_data(rctx); m.set_entries(RepeatedField::from_vec(vec![e])); - self.raft.step(m).is_ok(); + let _ = self.raft.step(m); } /// Returns the store as an immutable reference.