Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Shen <[email protected]>
  • Loading branch information
overvenus committed May 8, 2019
1 parent a8e209b commit 11599e7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion benches/benches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
8 changes: 4 additions & 4 deletions src/raft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ impl<T: Storage> Raft<T> {

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
}

Expand All @@ -695,7 +695,7 @@ impl<T: Storage> Raft<T> {
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()
Expand All @@ -710,7 +710,7 @@ impl<T: Storage> Raft<T> {
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
}
Expand Down Expand Up @@ -794,7 +794,7 @@ impl<T: Storage> Raft<T> {
}

fn num_pending_conf(&self, ents: &[Entry]) -> usize {
ents.into_iter()
ents.iter()
.filter(|e| e.get_entry_type() == EntryType::EntryConfChange)
.count()
}
Expand Down
8 changes: 4 additions & 4 deletions src/raw_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ impl<T: Storage> RawNode<T> {
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.
Expand All @@ -454,15 +454,15 @@ impl<T: Storage> RawNode<T> {
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.
pub fn transfer_leader(&mut self, transferee: u64) {
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.
Expand All @@ -475,7 +475,7 @@ impl<T: Storage> RawNode<T> {
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.
Expand Down

0 comments on commit 11599e7

Please sign in to comment.