From: kennytm Date: Mon, 15 Jan 2018 08:55:28 +0000 (+0800) Subject: Rollup merge of #47126 - sdroege:exact-chunks, r=bluss X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=5d0474ad73f2d9268f387726723fff44b88df3f7;p=rust.git Rollup merge of #47126 - sdroege:exact-chunks, r=bluss 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. Fixes https://github.com/rust-lang/rust/issues/47115 I'll add unit tests for all this if the general idea and behaviour makes sense for everybody. Also see https://github.com/rust-lang/rust/issues/47115#issuecomment-354715511 for an example what this improves. --- 5d0474ad73f2d9268f387726723fff44b88df3f7