iter_tools

Crates.ioiter_tools
lib.rsiter_tools
version0.19.0
sourcesrc
created_at2022-01-11 21:47:23.103289
updated_at2024-07-13 17:36:55.943694
descriptionCollection of general purpose tools to iterate. Currently it simply reexports itertools.
homepagehttps://github.com/Wandalen/wTools/tree/master/module/core/iter_tools
repositoryhttps://github.com/Wandalen/wTools/tree/master/module/core/iter_tools
max_upload_size
id512478
size39,017
Wandalen (Wandalen)

documentation

https://docs.rs/iter_tools

README

Module :: iter_tools

experimental rust-status docs.rs Open in Gitpod discord

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
Commit count: 0

cargo fmt