3 unstable releases
0.1.1 | Dec 4, 2022 |
---|---|
0.1.0 | Nov 29, 2022 |
0.0.0 | Nov 28, 2022 |
#2417 in Rust patterns
38 downloads per month
Used in 3 crates
8KB
58 lines
arrays
Collect an iterator into an array
Getting started
Add the arrays
crate to your Cargo manifest.
cargo add arrays
Now collect any iterator into an array.
let arr: [_; 3] = arrays::collect(iter).unwrap();
License
This project is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT for details.
lib.rs
:
Collect an iterator into an array
Getting started
Add the arrays
crate to your Cargo manifest.
cargo add arrays
Now collect any iterator into an array.
# let iter = 1..5;
let arr: [_; 3] = arrays::collect(iter).unwrap();