Skip to content

Commit

Permalink
Fix build for Rustc 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Jun 12, 2018
1 parent ee52a64 commit 83130e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/seq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ impl<T> SliceRandom for [T] {
if self.is_empty() {
None
} else {
Some(&mut self[rng.gen_range(0, self.len())])
let len = self.len();
Some(&mut self[rng.gen_range(0, len)])
}
}

Expand Down

0 comments on commit 83130e8

Please sign in to comment.