more-iter

Crates.iomore-iter
lib.rsmore-iter
version0.1.2
sourcesrc
created_at2023-05-29 07:25:00.638456
updated_at2023-05-31 05:45:30.209698
descriptionMore iterator utilities
homepagehttps://github.com/drmingdrmer/more-iter
repositoryhttps://github.com/drmingdrmer/more-iter
max_upload_size
id876982
size26,246
张炎泼 (drmingdrmer)

documentation

https://docs.rs/more-iter

README

more-iter

More iterating utilities in rust

MergePair

Merge two (key, value) iterators by key, keeping the largest value:

use more_iter::MergePair;

let a = [(1, 10), (3, 30), (4, 40)];
let b = [(2, 200), (3, 300)];

let merged = MergePair::merge(a, b, std::cmp::max).collect::<Vec<_>>();
assert_eq!(vec![(1, 10), (2, 200), (3, 300), (4, 40)], merged);
Commit count: 5

cargo fmt