Skip to content

Commit

Permalink
dep: adapt to changes of rand-0.8: gen_range() accepts a range instea…
Browse files Browse the repository at this point in the history
…d of two args
  • Loading branch information
drmingdrmer committed Jun 21, 2021
1 parent 69baa60 commit 70e1773
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion async-raft/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl Config {

/// Generate a new random election timeout within the configured min & max.
pub fn new_rand_election_timeout(&self) -> u64 {
thread_rng().gen_range(self.election_timeout_min, self.election_timeout_max)
thread_rng().gen_range(self.election_timeout_min..self.election_timeout_max)
}
}

Expand Down
3 changes: 2 additions & 1 deletion async-raft/src/metrics_wait_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,6 @@ fn init_wait_test() -> (RaftMetrics, Wait, watch::Sender<RaftMetrics>) {
timeout: Duration::from_millis(100),
rx,
};
return (init, w, tx);

(init, w, tx)
}

0 comments on commit 70e1773

Please sign in to comment.