Trait array_tool::vec::Uniq
[−]
[src]
pub trait Uniq { fn uniq(&self, other: Self) -> Self; fn unique(&self) -> Self; fn is_unique(&self) -> bool; }
Several different methods for getting, or evaluating, uniqueness.
Required Methods
fn uniq(&self, other: Self) -> Self
uniq
returns a vector of unique values within itself as compared to
the other vector which is provided as an input parameter.
Example
use array_tool::vec::Uniq; vec![1,2,3,4,5,6].uniq( vec![1,2,5,7,9] );
Output
vec![3,4,6]
fn unique(&self) -> Self
unique
removes duplicates from within the vector and returns Self.
Example
use array_tool::vec::Uniq; vec![1,2,1,3,2,3,4,5,6].unique();
Output
vec![1,2,3,4,5,6]