<!-- {{# generate.module_header{} #}} -->
# Module :: iter_tools
[](https://github.com/emersion/stability-badges#experimental) [](https://github.com/Wandalen/wTools/actions/workflows/ModuleIterToolsPush.yml) [](https://docs.rs/iter_tools) [](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=sample%2Frust%2Fiter_tools_trivial_sample%2Fsrc%2Fmain.rs,RUN_POSTFIX=--example%20iter_tools_trivial_sample/https://github.com/Wandalen/wTools) [](https://discord.gg/m3YfbXpUUY)
Collection of general purpose tools to iterate. Currently it simply reexports itertools.
### Basic use-case
<!-- {{# generate.module_sample{} #}} -->
```rust
#[ 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" ) ] );
}
```
<!-- # qqq : for Rust dev : please add --> <!-- aaa : done -->
### To add to your project
```sh
cargo add iter_tools
```
### Try out from the repository
```sh
git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/iter_tools_trivial
cargo run
```
# Sample
[](https://discord.gg/m3YfbXpUUY)
[](https://gitpod.io/#RUN_PATH=sample%2Frust%2Fiter_tools_trivial_sample,SAMPLE_FILE=.%2Fsrc%2Fmain.rs/https://github.com/Wandalen/wTools)
[](https://docs.rs/iter_tools)