@@ -155,7 +155,7 @@ enum DifferenceInner<'a, T: 'a> {
155
155
self_iter : Iter < ' a , T > ,
156
156
other_set : & ' a BTreeSet < T > ,
157
157
} ,
158
- Iterate ( Iter < ' a , T > ) , // simply produce all values in `self`
158
+ Iterate ( Iter < ' a , T > ) , // simply produce all elements in `self`
159
159
}
160
160
161
161
#[ stable( feature = "collection_debug" , since = "1.17.0" ) ]
@@ -207,7 +207,7 @@ enum IntersectionInner<'a, T: 'a> {
207
207
small_iter : Iter < ' a , T > ,
208
208
large_set : & ' a BTreeSet < T > ,
209
209
} ,
210
- Answer ( Option < & ' a T > ) , // return a specific value or emptiness
210
+ Answer ( Option < & ' a T > ) , // return a specific element or emptiness
211
211
}
212
212
213
213
#[ stable( feature = "collection_debug" , since = "1.17.0" ) ]
@@ -295,8 +295,8 @@ impl<T> BTreeSet<T> {
295
295
Range { iter : self . map . range ( range) }
296
296
}
297
297
298
- /// Visits the values representing the difference,
299
- /// i.e., the values that are in `self` but not in `other`,
298
+ /// Visits the elements representing the difference,
299
+ /// i.e., the elements that are in `self` but not in `other`,
300
300
/// in ascending order.
301
301
///
302
302
/// # Examples
@@ -356,8 +356,8 @@ impl<T> BTreeSet<T> {
356
356
}
357
357
}
358
358
359
- /// Visits the values representing the symmetric difference,
360
- /// i.e., the values that are in `self` or in `other` but not in both,
359
+ /// Visits the elements representing the symmetric difference,
360
+ /// i.e., the elements that are in `self` or in `other` but not in both,
361
361
/// in ascending order.
362
362
///
363
363
/// # Examples
@@ -384,8 +384,8 @@ impl<T> BTreeSet<T> {
384
384
SymmetricDifference ( MergeIterInner :: new ( self . iter ( ) , other. iter ( ) ) )
385
385
}
386
386
387
- /// Visits the values representing the intersection,
388
- /// i.e., the values that are both in `self` and `other`,
387
+ /// Visits the elements representing the intersection,
388
+ /// i.e., the elements that are both in `self` and `other`,
389
389
/// in ascending order.
390
390
///
391
391
/// # Examples
@@ -437,8 +437,8 @@ impl<T> BTreeSet<T> {
437
437
}
438
438
}
439
439
440
- /// Visits the values representing the union,
441
- /// i.e., all the values in `self` or `other`, without duplicates,
440
+ /// Visits the elements representing the union,
441
+ /// i.e., all the elements in `self` or `other`, without duplicates,
442
442
/// in ascending order.
443
443
///
444
444
/// # Examples
@@ -463,7 +463,7 @@ impl<T> BTreeSet<T> {
463
463
Union ( MergeIterInner :: new ( self . iter ( ) , other. iter ( ) ) )
464
464
}
465
465
466
- /// Clears the set, removing all values .
466
+ /// Clears the set, removing all elements .
467
467
///
468
468
/// # Examples
469
469
///
@@ -480,11 +480,11 @@ impl<T> BTreeSet<T> {
480
480
self . map . clear ( )
481
481
}
482
482
483
- /// Returns `true` if the set contains a value.
483
+ /// Returns `true` if the set contains an element equal to the value.
484
484
///
485
- /// The value may be any borrowed form of the set's value type,
485
+ /// The value may be any borrowed form of the set's element type,
486
486
/// but the ordering on the borrowed form *must* match the
487
- /// ordering on the value type.
487
+ /// ordering on the element type.
488
488
///
489
489
/// # Examples
490
490
///
@@ -504,11 +504,12 @@ impl<T> BTreeSet<T> {
504
504
self . map . contains_key ( value)
505
505
}
506
506
507
- /// Returns a reference to the value in the set, if any, that is equal to the given value.
507
+ /// Returns a reference to the element in the set, if any, that is equal to
508
+ /// the value.
508
509
///
509
- /// The value may be any borrowed form of the set's value type,
510
+ /// The value may be any borrowed form of the set's element type,
510
511
/// but the ordering on the borrowed form *must* match the
511
- /// ordering on the value type.
512
+ /// ordering on the element type.
512
513
///
513
514
/// # Examples
514
515
///
@@ -555,7 +556,7 @@ impl<T> BTreeSet<T> {
555
556
}
556
557
557
558
/// Returns `true` if the set is a subset of another,
558
- /// i.e., `other` contains at least all the values in `self`.
559
+ /// i.e., `other` contains at least all the elements in `self`.
559
560
///
560
561
/// # Examples
561
562
///
@@ -632,7 +633,7 @@ impl<T> BTreeSet<T> {
632
633
}
633
634
634
635
/// Returns `true` if the set is a superset of another,
635
- /// i.e., `self` contains at least all the values in `other`.
636
+ /// i.e., `self` contains at least all the elements in `other`.
636
637
///
637
638
/// # Examples
638
639
///
@@ -660,8 +661,8 @@ impl<T> BTreeSet<T> {
660
661
other. is_subset ( self )
661
662
}
662
663
663
- /// Returns a reference to the first value in the set, if any.
664
- /// This value is always the minimum of all values in the set.
664
+ /// Returns a reference to the first element in the set, if any.
665
+ /// This element is always the minimum of all elements in the set.
665
666
///
666
667
/// # Examples
667
668
///
@@ -687,8 +688,8 @@ impl<T> BTreeSet<T> {
687
688
self . map . first_key_value ( ) . map ( |( k, _) | k)
688
689
}
689
690
690
- /// Returns a reference to the last value in the set, if any.
691
- /// This value is always the maximum of all values in the set.
691
+ /// Returns a reference to the last element in the set, if any.
692
+ /// This element is always the maximum of all elements in the set.
692
693
///
693
694
/// # Examples
694
695
///
@@ -714,8 +715,8 @@ impl<T> BTreeSet<T> {
714
715
self . map . last_key_value ( ) . map ( |( k, _) | k)
715
716
}
716
717
717
- /// Removes the first value from the set and returns it, if any.
718
- /// The first value is always the minimum value in the set.
718
+ /// Removes the first element from the set and returns it, if any.
719
+ /// The first element is always the minimum element in the set.
719
720
///
720
721
/// # Examples
721
722
///
@@ -739,8 +740,8 @@ impl<T> BTreeSet<T> {
739
740
self . map . pop_first ( ) . map ( |kv| kv. 0 )
740
741
}
741
742
742
- /// Removes the last value from the set and returns it, if any.
743
- /// The last value is always the maximum value in the set.
743
+ /// Removes the last element from the set and returns it, if any.
744
+ /// The last element is always the maximum element in the set.
744
745
///
745
746
/// # Examples
746
747
///
@@ -766,10 +767,10 @@ impl<T> BTreeSet<T> {
766
767
767
768
/// Adds a value to the set.
768
769
///
769
- /// If the set did not have this value present, `true` is returned.
770
+ /// If the set did not have an equal element present, `true` is returned.
770
771
///
771
- /// If the set did have this value present, `false` is returned, and the
772
- /// entry is not updated. See the [module-level documentation] for more.
772
+ /// If the set did have an equal element present, `false` is returned, and
773
+ /// the entry is not updated. See the [module-level documentation] for more.
773
774
///
774
775
/// [module-level documentation]: index.html#insert-and-complex-keys
775
776
///
@@ -792,8 +793,8 @@ impl<T> BTreeSet<T> {
792
793
self . map . insert ( value, ( ) ) . is_none ( )
793
794
}
794
795
795
- /// Adds a value to the set, replacing the existing value , if any, that is equal to the given
796
- /// one . Returns the replaced value .
796
+ /// Adds a value to the set, replacing the existing element , if any, that is
797
+ /// equal to the value . Returns the replaced element .
797
798
///
798
799
/// # Examples
799
800
///
@@ -815,12 +816,12 @@ impl<T> BTreeSet<T> {
815
816
Recover :: replace ( & mut self . map , value)
816
817
}
817
818
818
- /// Removes a value from the set. Returns whether the value was
819
- /// present in the set .
819
+ /// If the set contains an element equal to the value, removes it from the
820
+ /// set and drops it. Returns whether such an element was present .
820
821
///
821
- /// The value may be any borrowed form of the set's value type,
822
+ /// The value may be any borrowed form of the set's element type,
822
823
/// but the ordering on the borrowed form *must* match the
823
- /// ordering on the value type.
824
+ /// ordering on the element type.
824
825
///
825
826
/// # Examples
826
827
///
@@ -842,11 +843,12 @@ impl<T> BTreeSet<T> {
842
843
self . map . remove ( value) . is_some ( )
843
844
}
844
845
845
- /// Removes and returns the value in the set, if any, that is equal to the given one.
846
+ /// Removes and returns the element in the set, if any, that is equal to
847
+ /// the value.
846
848
///
847
- /// The value may be any borrowed form of the set's value type,
849
+ /// The value may be any borrowed form of the set's element type,
848
850
/// but the ordering on the borrowed form *must* match the
849
- /// ordering on the value type.
851
+ /// ordering on the element type.
850
852
///
851
853
/// # Examples
852
854
///
@@ -926,8 +928,8 @@ impl<T> BTreeSet<T> {
926
928
self . map . append ( & mut other. map ) ;
927
929
}
928
930
929
- /// Splits the collection into two at the given value. Returns everything after the given value,
930
- /// including the value.
931
+ /// Splits the collection into two at the value. Returns a new collection
932
+ /// with all elements greater than or equal to the value.
931
933
///
932
934
/// # Examples
933
935
///
@@ -963,20 +965,20 @@ impl<T> BTreeSet<T> {
963
965
BTreeSet { map : self . map . split_off ( value) }
964
966
}
965
967
966
- /// Creates an iterator that visits all values in ascending order and uses a closure
967
- /// to determine if a value should be removed.
968
+ /// Creates an iterator that visits all elements in ascending order and
969
+ /// uses a closure to determine if an element should be removed.
968
970
///
969
- /// If the closure returns `true`, the value is removed from the set and yielded. If
970
- /// the closure returns `false`, or panics, the value remains in the set and will
971
- /// not be yielded.
971
+ /// If the closure returns `true`, the element is removed from the set and
972
+ /// yielded. If the closure returns `false`, or panics, the element remains
973
+ /// in the set and will not be yielded.
972
974
///
973
- /// If the iterator is only partially consumed or not consumed at all, each of the
974
- /// remaining values is still subjected to the closure and removed and dropped if it
975
- /// returns `true`.
975
+ /// If the iterator is only partially consumed or not consumed at all, each
976
+ /// of the remaining elements is still subjected to the closure and removed
977
+ /// and dropped if it returns `true`.
976
978
///
977
- /// It is unspecified how many more values will be subjected to the closure if a
978
- /// panic occurs in the closure, or if a panic occurs while dropping a value, or if
979
- /// the `DrainFilter` itself is leaked.
979
+ /// It is unspecified how many more elements will be subjected to the
980
+ /// closure if a panic occurs in the closure, or if a panic occurs while
981
+ /// dropping an element, or if the `DrainFilter` itself is leaked.
980
982
///
981
983
/// # Examples
982
984
///
@@ -1001,7 +1003,8 @@ impl<T> BTreeSet<T> {
1001
1003
DrainFilter { pred, inner : self . map . drain_filter_inner ( ) }
1002
1004
}
1003
1005
1004
- /// Gets an iterator that visits the values in the `BTreeSet` in ascending order.
1006
+ /// Gets an iterator that visits the elements in the `BTreeSet` in ascending
1007
+ /// order.
1005
1008
///
1006
1009
/// # Examples
1007
1010
///
0 commit comments