]> git.lizzy.rs Git - rust.git/commit
Add slice::ExactChunks and ::ExactChunksMut iterators
authorSebastian Dröge <sebastian@centricular.com>
Tue, 2 Jan 2018 00:13:20 +0000 (02:13 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 13 Jan 2018 10:18:46 +0000 (12:18 +0200)
commit51d546f4aa8a94b81d2a580518d95d1ab12a3655
treec490689fc10b38b4abf7e4494ea72d876c138ef9
parent2e33c89ff1518359c4bd5fbed1571ea00cb3b146
Add slice::ExactChunks and ::ExactChunksMut iterators

These guarantee that always the requested slice size will be returned
and any leftoever elements at the end will be ignored. It allows llvm to
get rid of bounds checks in the code using the iterator.

This is inspired by the same iterators provided by ndarray.

See https://github.com/rust-lang/rust/issues/47115
src/liballoc/lib.rs
src/liballoc/slice.rs
src/libcore/slice/mod.rs