19 releases
| 0.3.8 | May 20, 2025 |
|---|---|
| 0.3.4 | Apr 22, 2025 |
| 0.3.3 | Feb 21, 2025 |
| 0.2.10 | Sep 29, 2024 |
| 0.2.4 | Jul 7, 2024 |
#114 in No standard library
580 downloads per month
46KB
1.5K
SLoC
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);
# use itermaps::FilterExt;
let mut iter = [1, 2, 3].iter().filter_ne(&&2);
assert_eq!(iter.next(), Some(&1));
assert_eq!(iter.next(), Some(&3));
assert_eq!(iter.next(), None);