use crate::functions::*;
pub trait IntoDeduped<Item>: crate::sealed::IsVec {
fn into_deduped(self) -> Self
where
Item: PartialEq;
fn into_deduped_by<SameBucket>(self, same_bucket: SameBucket) -> Self
where
SameBucket: FnMut(&mut Item, &mut Item) -> bool;
fn into_deduped_by_key<Key, GetKey>(self, key: GetKey) -> Self
where
GetKey: FnMut(&mut Item) -> Key,
Key: PartialEq;
}
impl<Item> IntoDeduped<Item> for Vec<Item> {
fn into_deduped(self) -> Self
where
Item: PartialEq,
{
into_deduped(self)
}
fn into_deduped_by<SameBucket>(self, same_bucket: SameBucket) -> Self
where
SameBucket: FnMut(&mut Item, &mut Item) -> bool,
{
into_deduped_by(self, same_bucket)
}
fn into_deduped_by_key<Key, GetKey>(self, key: GetKey) -> Self
where
GetKey: FnMut(&mut Item) -> Key,
Key: PartialEq,
{
into_deduped_by_key(self, key)
}
}