oxilean_std/hashset/oxihashset_insert_group.rs
1//! # OxiHashSet - insert_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 /// Insert an element. Returns `true` if the element was not already present.
12 pub fn insert(&mut self, elem: T) -> bool {
13 self.inner.insert(elem)
14 }
15 /// Extend with elements from another set (union in place).
16 pub fn union_with(&mut self, other: &Self) {
17 for elem in &other.inner {
18 self.inner.insert(elem.clone());
19 }
20 }
21}