Expand description
Implement commonly used combinations of Iterator::map
§Examples
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);
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);
Modules§
- short_
funcs - Short traits method name, e.g
Unpack::unpack
->unpack
Macros§
- fields
- Generate a closure extract fields to tuple.
Structs§
- MapIndex
- Create from
map_index
- MapIndex
Mut - Create from
map_index_mut
Traits§
- Filter
Ext - Implement commonly used combinations of
Iterator::filter
- MapExt
- Implement commonly used combinations of
Iterator::map
- ThisMut
- Consume self into mutable reference
- ThisRef
- Consume self into reference
- Unpack
- Unpack, e.g
&(A, B)
into(&A, &B)