MCPcopy Create free account
hub / github.com/Lokathor/tinyvec / dedup_by

Method dedup_by

src/arrayvec.rs:1235–1244  ·  view source on GitHub ↗
(&mut self, same_bucket: F)

Source from the content-addressed store, hash-verified

1233 /// De-duplicates the vec according to the predicate given.
1234 #[inline(always)]
1235 pub fn dedup_by<F>(&mut self, same_bucket: F)
1236 where
1237 F: FnMut(&mut A::Item, &mut A::Item) -> bool,
1238 {
1239 let len = {
1240 let (dedup, _) = self.as_mut_slice().partition_dedup_by(same_bucket);
1241 dedup.len()
1242 };
1243 self.truncate(len);
1244 }
1245
1246 /// De-duplicates the vec according to the key selector given.
1247 #[inline(always)]

Callers 2

dedupMethod · 0.45
dedup_by_keyMethod · 0.45

Calls 3

as_mut_sliceMethod · 0.45
lenMethod · 0.45
truncateMethod · 0.45

Tested by

no test coverage detected