@@ -5,9 +5,7 @@ use alloc::borrow::ToOwned;
5
5
use core:: fmt;
6
6
use core:: hash:: { BuildHasher , Hash } ;
7
7
use core:: iter:: { Chain , FusedIterator } ;
8
- use core:: ops:: {
9
- Add , AddAssign , BitAnd , BitAndAssign , BitOr , BitOrAssign , BitXor , BitXorAssign , Sub , SubAssign ,
10
- } ;
8
+ use core:: ops:: { BitAnd , BitAndAssign , BitOr , BitOrAssign , BitXor , BitXorAssign , Sub , SubAssign } ;
11
9
12
10
use super :: map:: { self , DefaultHashBuilder , HashMap , Keys } ;
13
11
use crate :: raw:: { Allocator , Global , RawExtractIf } ;
@@ -1504,38 +1502,6 @@ where
1504
1502
}
1505
1503
}
1506
1504
1507
- impl < T , S > Add < & HashSet < T , S > > for & HashSet < T , S >
1508
- where
1509
- T : Eq + Hash + Clone ,
1510
- S : BuildHasher + Default ,
1511
- {
1512
- type Output = HashSet < T , S > ;
1513
-
1514
- /// Returns the union of `self` and `rhs` as a new `HashSet<T, S>`.
1515
- ///
1516
- /// # Examples
1517
- ///
1518
- /// ```
1519
- /// use hashbrown::HashSet;
1520
- ///
1521
- /// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
1522
- /// let b: HashSet<_> = vec![2, 3, 4].into_iter().collect();
1523
- ///
1524
- /// let set = &a + &b;
1525
- ///
1526
- /// let mut i = 0;
1527
- /// let expected = [1, 2, 3, 4];
1528
- /// for x in &set {
1529
- /// assert!(expected.contains(x));
1530
- /// i += 1;
1531
- /// }
1532
- /// assert_eq!(i, expected.len());
1533
- /// ```
1534
- fn add ( self , rhs : & HashSet < T , S > ) -> HashSet < T , S > {
1535
- self . union ( rhs) . cloned ( ) . collect ( )
1536
- }
1537
- }
1538
-
1539
1505
impl < T , S > Sub < & HashSet < T , S > > for & HashSet < T , S >
1540
1506
where
1541
1507
T : Eq + Hash + Clone ,
@@ -1672,40 +1638,6 @@ where
1672
1638
}
1673
1639
}
1674
1640
1675
- impl < T , S > AddAssign < & HashSet < T , S > > for HashSet < T , S >
1676
- where
1677
- T : Eq + Hash + Clone ,
1678
- S : BuildHasher ,
1679
- {
1680
- /// Modifies this set to contain the union of `self` and `rhs`.
1681
- ///
1682
- /// # Examples
1683
- ///
1684
- /// ```
1685
- /// use hashbrown::HashSet;
1686
- ///
1687
- /// let mut a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
1688
- /// let b: HashSet<_> = vec![2, 3, 4].into_iter().collect();
1689
- ///
1690
- /// a += &b;
1691
- ///
1692
- /// let mut i = 0;
1693
- /// let expected = [1, 2, 3, 4];
1694
- /// for x in &a {
1695
- /// assert!(expected.contains(x));
1696
- /// i += 1;
1697
- /// }
1698
- /// assert_eq!(i, expected.len());
1699
- /// ```
1700
- fn add_assign ( & mut self , rhs : & HashSet < T , S > ) {
1701
- for item in rhs {
1702
- if !self . contains ( item) {
1703
- self . insert ( item. clone ( ) ) ;
1704
- }
1705
- }
1706
- }
1707
- }
1708
-
1709
1641
impl < T , S > SubAssign < & HashSet < T , S > > for HashSet < T , S >
1710
1642
where
1711
1643
T : Eq + Hash + Clone ,
0 commit comments