@@ -102,7 +102,7 @@ use crate::raw::{Allocator, Global, RawExtractIf};
102102/// use hashbrown::HashSet;
103103///
104104/// let viking_names: HashSet<&'static str> =
105- /// [ "Einar", "Olaf", "Harald" ].iter().cloned ().collect();
105+ /// [ "Einar", "Olaf", "Harald" ].into_iter ().collect();
106106/// // use the values stored in the set
107107/// ```
108108///
@@ -335,7 +335,7 @@ impl<T, S, A: Allocator> HashSet<T, S, A> {
335335 /// ```
336336 /// use hashbrown::HashSet;
337337 ///
338- /// let mut set: HashSet<_> = [1, 2, 3].iter().cloned ().collect();
338+ /// let mut set: HashSet<_> = [1, 2, 3].into_iter ().collect();
339339 /// assert!(!set.is_empty());
340340 ///
341341 /// // print 1, 2, 3 in an arbitrary order
@@ -362,7 +362,7 @@ impl<T, S, A: Allocator> HashSet<T, S, A> {
362362 /// use hashbrown::HashSet;
363363 ///
364364 /// let xs = [1,2,3,4,5,6];
365- /// let mut set: HashSet<i32> = xs.iter().cloned ().collect();
365+ /// let mut set: HashSet<i32> = xs.into_iter ().collect();
366366 /// set.retain(|&k| k % 2 == 0);
367367 /// assert_eq!(set.len(), 3);
368368 /// ```
@@ -724,8 +724,8 @@ where
724724 ///
725725 /// ```
726726 /// use hashbrown::HashSet;
727- /// let a: HashSet<_> = [1, 2, 3].iter().cloned ().collect();
728- /// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned ().collect();
727+ /// let a: HashSet<_> = [1, 2, 3].into_iter ().collect();
728+ /// let b: HashSet<_> = [4, 2, 3, 4].into_iter ().collect();
729729 ///
730730 /// // Can be seen as `a - b`.
731731 /// for x in a.difference(&b) {
@@ -755,8 +755,8 @@ where
755755 ///
756756 /// ```
757757 /// use hashbrown::HashSet;
758- /// let a: HashSet<_> = [1, 2, 3].iter().cloned ().collect();
759- /// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned ().collect();
758+ /// let a: HashSet<_> = [1, 2, 3].into_iter ().collect();
759+ /// let b: HashSet<_> = [4, 2, 3, 4].into_iter ().collect();
760760 ///
761761 /// // Print 1, 4 in arbitrary order.
762762 /// for x in a.symmetric_difference(&b) {
@@ -783,8 +783,8 @@ where
783783 ///
784784 /// ```
785785 /// use hashbrown::HashSet;
786- /// let a: HashSet<_> = [1, 2, 3].iter().cloned ().collect();
787- /// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned ().collect();
786+ /// let a: HashSet<_> = [1, 2, 3].into_iter ().collect();
787+ /// let b: HashSet<_> = [4, 2, 3, 4].into_iter ().collect();
788788 ///
789789 /// // Print 2, 3 in arbitrary order.
790790 /// for x in a.intersection(&b) {
@@ -814,8 +814,8 @@ where
814814 ///
815815 /// ```
816816 /// use hashbrown::HashSet;
817- /// let a: HashSet<_> = [1, 2, 3].iter().cloned ().collect();
818- /// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned ().collect();
817+ /// let a: HashSet<_> = [1, 2, 3].into_iter ().collect();
818+ /// let b: HashSet<_> = [4, 2, 3, 4].into_iter ().collect();
819819 ///
820820 /// // Print 1, 2, 3, 4 in arbitrary order.
821821 /// for x in a.union(&b) {
@@ -850,7 +850,7 @@ where
850850 /// ```
851851 /// use hashbrown::HashSet;
852852 ///
853- /// let set: HashSet<_> = [1, 2, 3].iter().cloned ().collect();
853+ /// let set: HashSet<_> = [1, 2, 3].into_iter ().collect();
854854 /// assert_eq!(set.contains(&1), true);
855855 /// assert_eq!(set.contains(&4), false);
856856 /// ```
@@ -876,7 +876,7 @@ where
876876 /// ```
877877 /// use hashbrown::HashSet;
878878 ///
879- /// let set: HashSet<_> = [1, 2, 3].iter().cloned ().collect();
879+ /// let set: HashSet<_> = [1, 2, 3].into_iter ().collect();
880880 /// assert_eq!(set.get(&2), Some(&2));
881881 /// assert_eq!(set.get(&4), None);
882882 /// ```
@@ -903,7 +903,7 @@ where
903903 /// ```
904904 /// use hashbrown::HashSet;
905905 ///
906- /// let mut set: HashSet<_> = [1, 2, 3].iter().cloned ().collect();
906+ /// let mut set: HashSet<_> = [1, 2, 3].into_iter ().collect();
907907 /// assert_eq!(set.len(), 3);
908908 /// assert_eq!(set.get_or_insert(2), &2);
909909 /// assert_eq!(set.get_or_insert(100), &100);
@@ -1034,7 +1034,7 @@ where
10341034 /// ```
10351035 /// use hashbrown::HashSet;
10361036 ///
1037- /// let a: HashSet<_> = [1, 2, 3].iter().cloned ().collect();
1037+ /// let a: HashSet<_> = [1, 2, 3].into_iter ().collect();
10381038 /// let mut b = HashSet::new();
10391039 ///
10401040 /// assert_eq!(a.is_disjoint(&b), true);
@@ -1055,7 +1055,7 @@ where
10551055 /// ```
10561056 /// use hashbrown::HashSet;
10571057 ///
1058- /// let sup: HashSet<_> = [1, 2, 3].iter().cloned ().collect();
1058+ /// let sup: HashSet<_> = [1, 2, 3].into_iter ().collect();
10591059 /// let mut set = HashSet::new();
10601060 ///
10611061 /// assert_eq!(set.is_subset(&sup), true);
@@ -1076,7 +1076,7 @@ where
10761076 /// ```
10771077 /// use hashbrown::HashSet;
10781078 ///
1079- /// let sub: HashSet<_> = [1, 2].iter().cloned ().collect();
1079+ /// let sub: HashSet<_> = [1, 2].into_iter ().collect();
10801080 /// let mut set = HashSet::new();
10811081 ///
10821082 /// assert_eq!(set.is_superset(&sub), false);
@@ -1205,7 +1205,7 @@ where
12051205 /// ```
12061206 /// use hashbrown::HashSet;
12071207 ///
1208- /// let mut set: HashSet<_> = [1, 2, 3].iter().cloned ().collect();
1208+ /// let mut set: HashSet<_> = [1, 2, 3].into_iter ().collect();
12091209 /// assert_eq!(set.take(&2), Some(2));
12101210 /// assert_eq!(set.take(&2), None);
12111211 /// ```
0 commit comments