diff options
| author | Sebastian Dröge <sebastian@centricular.com> | 2018-09-24 22:43:06 +0300 |
|---|---|---|
| committer | Sebastian Dröge <sebastian@centricular.com> | 2018-09-24 22:43:06 +0300 |
| commit | e09e45041b5cab9d849b554824c6683de6372e41 (patch) | |
| tree | 679312b6a8193f610e4d8e84c15c05298353c4f4 /src/liballoc/tests | |
| parent | a072d1bca6282d1d2fbec103d12393527eb5a868 (diff) | |
| download | rust-e09e45041b5cab9d849b554824c6683de6372e41.tar.gz rust-e09e45041b5cab9d849b554824c6683de6372e41.zip | |
Rename slice::exact_chunks() to slice::chunks_exact()
See https://github.com/rust-lang/rust/issues/47115#issuecomment-403090815 and https://github.com/rust-lang/rust/issues/47115#issuecomment-424053547
Diffstat (limited to 'src/liballoc/tests')
| -rw-r--r-- | src/liballoc/tests/lib.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/tests/slice.rs | 30 |
2 files changed, 16 insertions, 16 deletions
diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs index 710c659ac53..6ff39227555 100644 --- a/src/liballoc/tests/lib.rs +++ b/src/liballoc/tests/lib.rs @@ -20,7 +20,7 @@ #![feature(str_escape)] #![feature(try_reserve)] #![feature(unboxed_closures)] -#![feature(exact_chunks)] +#![feature(chunks_exact)] #![feature(repeat_generic_slice)] extern crate alloc_system; diff --git a/src/liballoc/tests/slice.rs b/src/liballoc/tests/slice.rs index f33bf64d40b..c214c59618d 100644 --- a/src/liballoc/tests/slice.rs +++ b/src/liballoc/tests/slice.rs @@ -975,27 +975,27 @@ fn test_chunksator_0() { } #[test] -fn test_exact_chunksator() { +fn test_chunks_exactator() { let v = &[1, 2, 3, 4, 5]; - assert_eq!(v.exact_chunks(2).len(), 2); + assert_eq!(v.chunks_exact(2).len(), 2); let chunks: &[&[_]] = &[&[1, 2], &[3, 4]]; - assert_eq!(v.exact_chunks(2).collect::<Vec<_>>(), chunks); + assert_eq!(v.chunks_exact(2).collect::<Vec<_>>(), chunks); let chunks: &[&[_]] = &[&[1, 2, 3]]; - assert_eq!(v.exact_chunks(3).collect::<Vec<_>>(), chunks); + assert_eq!(v.chunks_exact(3).collect::<Vec<_>>(), chunks); let chunks: &[&[_]] = &[]; - assert_eq!(v.exact_chunks(6).collect::<Vec<_>>(), chunks); + assert_eq!(v.chunks_exact(6).collect::<Vec<_>>(), chunks); let chunks: &[&[_]] = &[&[3, 4], &[1, 2]]; - assert_eq!(v.exact_chunks(2).rev().collect::<Vec<_>>(), chunks); + assert_eq!(v.chunks_exact(2).rev().collect::<Vec<_>>(), chunks); } #[test] #[should_panic] -fn test_exact_chunksator_0() { +fn test_chunks_exactator_0() { let v = &[1, 2, 3, 4]; - let _it = v.exact_chunks(0); + let _it = v.chunks_exact(0); } #[test] @@ -1235,10 +1235,10 @@ fn test_mut_chunks_0() { } #[test] -fn test_mut_exact_chunks() { +fn test_mut_chunks_exact() { let mut v = [0, 1, 2, 3, 4, 5, 6]; - assert_eq!(v.exact_chunks_mut(2).len(), 3); - for (i, chunk) in v.exact_chunks_mut(3).enumerate() { + assert_eq!(v.chunks_exact_mut(2).len(), 3); + for (i, chunk) in v.chunks_exact_mut(3).enumerate() { for x in chunk { *x = i as u8; } @@ -1248,9 +1248,9 @@ fn test_mut_exact_chunks() { } #[test] -fn test_mut_exact_chunks_rev() { +fn test_mut_chunks_exact_rev() { let mut v = [0, 1, 2, 3, 4, 5, 6]; - for (i, chunk) in v.exact_chunks_mut(3).rev().enumerate() { + for (i, chunk) in v.chunks_exact_mut(3).rev().enumerate() { for x in chunk { *x = i as u8; } @@ -1261,9 +1261,9 @@ fn test_mut_exact_chunks_rev() { #[test] #[should_panic] -fn test_mut_exact_chunks_0() { +fn test_mut_chunks_exact_0() { let mut v = [1, 2, 3, 4]; - let _it = v.exact_chunks_mut(0); + let _it = v.chunks_exact_mut(0); } #[test] |
