#[cfg(test)]
mod test;
pub trait SameElements<T> {
fn same_elements(self, other: Self) -> bool;
}
impl<T> SameElements<T> for &[T]
where
T: PartialEq,
{
fn same_elements(self, other: Self) -> bool {
if self.len() != other.len() {
return false;
}
for elem in self.iter() {
if !other.contains(elem) {
return false;
}
}
true
}
}