diff options
| author | bors <bors@rust-lang.org> | 2019-02-03 18:40:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-02-03 18:40:23 +0000 |
| commit | 4f4f4a40b6c7bcb6fa07ee6575e8a9759ba08922 (patch) | |
| tree | 28a3d197b75da9125cc8f6de8d912f75c56e7e48 /src/liballoc/tests/slice.rs | |
| parent | e858c2637fa5bac40ac450628b30c56c2b4327b4 (diff) | |
| parent | 2396780cdaedf097dd6a8f3927749bcaf5b1238b (diff) | |
| download | rust-4f4f4a40b6c7bcb6fa07ee6575e8a9759ba08922.tar.gz rust-4f4f4a40b6c7bcb6fa07ee6575e8a9759ba08922.zip | |
Auto merge of #58081 - Centril:liballoc-2018, r=oli-obk
Transition liballoc to Rust 2018 This transitions liballoc to Rust 2018 edition and applies relevant idiom lints. I also did a small bit of drive-by cleanup along the way. r? @oli-obk I started with liballoc since it seemed easiest. In particular, adding `edition = "2018"` to libcore gave me way too many errors due to stdsimd. Ideally we should be able to continue this crate-by-crate until all crates use 2018.
Diffstat (limited to 'src/liballoc/tests/slice.rs')
| -rw-r--r-- | src/liballoc/tests/slice.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/liballoc/tests/slice.rs b/src/liballoc/tests/slice.rs index 0300bd7f3f6..334466dfb25 100644 --- a/src/liballoc/tests/slice.rs +++ b/src/liballoc/tests/slice.rs @@ -1,14 +1,13 @@ use std::cell::Cell; -use std::cmp::Ordering::{Equal, Greater, Less}; -use std::cmp::Ordering; +use std::cmp::Ordering::{self, Equal, Greater, Less}; use std::mem; use std::panic; use std::rc::Rc; -use std::sync::atomic::Ordering::Relaxed; -use std::sync::atomic::AtomicUsize; +use std::sync::atomic::{Ordering::Relaxed, AtomicUsize}; use std::thread; -use rand::{Rng, RngCore, thread_rng, seq::SliceRandom}; +use rand::{Rng, RngCore, thread_rng}; +use rand::seq::SliceRandom; use rand::distributions::Standard; fn square(n: usize) -> usize { @@ -476,7 +475,7 @@ fn test_sort_stability() { // the second item represents which occurrence of that // number this element is, i.e., the second elements // will occur in sorted order. - let mut orig: Vec<_> = (0..len) + let orig: Vec<_> = (0..len) .map(|_| { let n = thread_rng().gen::<usize>() % 10; counts[n] += 1; |
