22 breaking releases
0.24.0 | Oct 30, 2024 |
---|---|
0.22.0 | Oct 30, 2024 |
0.20.0 | Jul 13, 2024 |
0.15.0 | Mar 22, 2024 |
0.1.0 | Jan 11, 2022 |
#920 in Algorithms
9,481 downloads per month
Used in 105 crates
(19 directly)
35KB
402 lines
Module :: iter_tools
Collection of general purpose tools to iterate. Currently it simply reexports itertools.
Basic use-case
# #[ cfg( feature = "itertools" ) ]
# {
use iter_tools::*;
/* standard functions */
let vec = vec![ 5, 1, -2 ];
let min = min( &vec );
assert_eq!( *min.unwrap(), -2 );
/* non standard functions */
let vec = vec![ 5, 1, -2 ];
let added = vec![ "a", "b", "c" ];
let mut result = vec![];
let zipped = zip( &vec, &added );
for ( left, right ) in zipped
{
result.push( ( *left, *right ) );
}
assert_eq!( result, vec![ ( 5, "a" ), ( 1, "b" ), ( -2, "c" ) ] );
# }
To add to your project
cargo add iter_tools
Try out from the repository
git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/iter_tools_trivial
cargo run
`
Try out from the repository
git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/iter_tools_trivial
cargo run
Dependencies
~460KB