Skip to main content

Rdedup

Trait Rdedup 

Source
pub trait Rdedup {
    type Item;

    // Required method
    fn rdedup_by_key<K, F>(&mut self, key: F)
       where F: Fn(&mut Self::Item) -> K,
             K: PartialEq<K>;
}
Expand description

A variant of dedup that keeps the later value rather than the earlier one.

Required Associated Types§

Required Methods§

Source

fn rdedup_by_key<K, F>(&mut self, key: F)
where F: Fn(&mut Self::Item) -> K, K: PartialEq<K>,

Deduplicates values in a sorted sequence using a key function, but unlike the standard version keeps the later one.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Copy, const N: usize> Rdedup for SmallVec<[T; N]>

Source§

type Item = T

Source§

fn rdedup_by_key<K, F>(&mut self, key: F)
where T: Copy, K: PartialEq<K>, F: FnMut(&mut T) -> K,

Implementors§