Crates.io | itermaps |
lib.rs | itermaps |
version | 0.2.10 |
source | src |
created_at | 2024-06-24 19:15:19.267301 |
updated_at | 2024-09-29 20:11:28.934145 |
description | Implement commonly used combinations of `Iterator::map` |
homepage | https://github.com/A4-Tacks/itermaps-rs |
repository | https://github.com/A4-Tacks/itermaps-rs |
max_upload_size | |
id | 1282459 |
size | 33,946 |
Implement commonly used combinations of Iterator::map
# 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);