@@ -325,13 +325,13 @@ impl<T, S> HashSet<T, S>
325
325
/// println!("{}", x); // Print 1
326
326
/// }
327
327
///
328
- /// let diff: HashSet<_> = a.difference(&b).cloned(). collect();
329
- /// assert_eq!(diff, [1].iter().cloned(). collect());
328
+ /// let diff: HashSet<_> = a.difference(&b).collect();
329
+ /// assert_eq!(diff, [1].iter().collect());
330
330
///
331
331
/// // Note that difference is not symmetric,
332
332
/// // and `b - a` means something else:
333
- /// let diff: HashSet<_> = b.difference(&a).cloned(). collect();
334
- /// assert_eq!(diff, [4].iter().cloned(). collect());
333
+ /// let diff: HashSet<_> = b.difference(&a).collect();
334
+ /// assert_eq!(diff, [4].iter().collect());
335
335
/// ```
336
336
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
337
337
pub fn difference < ' a > ( & ' a self , other : & ' a HashSet < T , S > ) -> Difference < ' a , T , S > {
@@ -356,11 +356,11 @@ impl<T, S> HashSet<T, S>
356
356
/// println!("{}", x);
357
357
/// }
358
358
///
359
- /// let diff1: HashSet<_> = a.symmetric_difference(&b).cloned(). collect();
360
- /// let diff2: HashSet<_> = b.symmetric_difference(&a).cloned(). collect();
359
+ /// let diff1: HashSet<_> = a.symmetric_difference(&b).collect();
360
+ /// let diff2: HashSet<_> = b.symmetric_difference(&a).collect();
361
361
///
362
362
/// assert_eq!(diff1, diff2);
363
- /// assert_eq!(diff1, [1, 4].iter().cloned(). collect());
363
+ /// assert_eq!(diff1, [1, 4].iter().collect());
364
364
/// ```
365
365
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
366
366
pub fn symmetric_difference < ' a > ( & ' a self ,
@@ -384,8 +384,8 @@ impl<T, S> HashSet<T, S>
384
384
/// println!("{}", x);
385
385
/// }
386
386
///
387
- /// let intersection: HashSet<_> = a.intersection(&b).cloned(). collect();
388
- /// assert_eq!(intersection, [2, 3].iter().cloned(). collect());
387
+ /// let intersection: HashSet<_> = a.intersection(&b).collect();
388
+ /// assert_eq!(intersection, [2, 3].iter().collect());
389
389
/// ```
390
390
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
391
391
pub fn intersection < ' a > ( & ' a self , other : & ' a HashSet < T , S > ) -> Intersection < ' a , T , S > {
@@ -410,8 +410,8 @@ impl<T, S> HashSet<T, S>
410
410
/// println!("{}", x);
411
411
/// }
412
412
///
413
- /// let union: HashSet<_> = a.union(&b).cloned(). collect();
414
- /// assert_eq!(union, [1, 2, 3, 4].iter().cloned(). collect());
413
+ /// let union: HashSet<_> = a.union(&b).collect();
414
+ /// assert_eq!(union, [1, 2, 3, 4].iter().collect());
415
415
/// ```
416
416
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
417
417
pub fn union < ' a > ( & ' a self , other : & ' a HashSet < T , S > ) -> Union < ' a , T , S > {
0 commit comments