#iterator-extension #iterator #extension #adapter

no-std itermaps

Implement commonly used combinations of Iterator::map

10 releases

0.2.10 Sep 29, 2024
0.2.9 Sep 17, 2024
0.2.8 Aug 11, 2024
0.2.4 Jul 7, 2024
0.1.1 Jun 24, 2024

#627 in Algorithms

MIT license

33KB
892 lines

Implement commonly used combinations of Iterator::map

Examples

# use itermaps::MapExt;
let arr = [[1, 2], [3, 4]];
let first: Vec<i32> = arr.iter().map_index(0).copied().collect();
assert_eq!(first, [1, 3]);

let arr = ["foo", "bar"];
let arr1: Vec<String> = arr.into_iter().map_to_owned().collect();
assert_eq!(arr1, arr);

No runtime deps

Features