Skip to main content

oxilean_std/hashset/
oxihashset_contains_group.rs

1//! # OxiHashSet - contains_group Methods
2//!
3//! This module contains method implementations for `OxiHashSet`.
4//!
5//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
6
7use super::oxihashset_type::OxiHashSet;
8use std::hash::Hash;
9
10impl<T: Eq + Hash + Clone> OxiHashSet<T> {
11    /// Check whether the set contains an element.
12    pub fn contains(&self, elem: &T) -> bool {
13        self.inner.contains(elem)
14    }
15    /// Keep only elements that also appear in `other` (intersection in place).
16    pub fn intersect_with(&mut self, other: &Self) {
17        self.inner.retain(|e| other.inner.contains(e));
18    }
19}