Crates.io | dedup_by |
lib.rs | dedup_by |
version | 0.1.0 |
source | src |
created_at | 2016-07-18 23:01:45.473769 |
updated_at | 2016-07-18 23:01:45.473769 |
description | A helper function for removing consecutive duplicates from a vector of complex types |
homepage | |
repository | https://github.com/insanitybit/dedup_by |
max_upload_size | |
id | 5711 |
size | 4,819 |
A helper function for removing consecutive duplicates from a vector of complex types
use dedup_by::dedup_by;
let mut vec = vec![(1, 2), (2, 2), (3, 1)];
dedup_by(&mut vec, |a, b| { a.1 == b.1 });
assert_eq!(vec, [(1, 2), (3, 1)]);