Skip to content

Commit 10b65c8

Browse files
committed
Make BTreeSet::split_off name elements like other set methods do
1 parent b5a2cce commit 10b65c8

File tree

1 file changed

+4
-4
lines changed
  • library/alloc/src/collections/btree

1 file changed

+4
-4
lines changed

library/alloc/src/collections/btree/set.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -903,8 +903,8 @@ impl<T> BTreeSet<T> {
903903
self.map.append(&mut other.map);
904904
}
905905

906-
/// Splits the collection into two at the given key. Returns everything after the given key,
907-
/// including the key.
906+
/// Splits the collection into two at the given value. Returns everything after the given value,
907+
/// including the value.
908908
///
909909
/// # Examples
910910
///
@@ -933,11 +933,11 @@ impl<T> BTreeSet<T> {
933933
/// assert!(b.contains(&41));
934934
/// ```
935935
#[stable(feature = "btree_split_off", since = "1.11.0")]
936-
pub fn split_off<Q: ?Sized + Ord>(&mut self, key: &Q) -> Self
936+
pub fn split_off<Q: ?Sized + Ord>(&mut self, value: &Q) -> Self
937937
where
938938
T: Borrow<Q> + Ord,
939939
{
940-
BTreeSet { map: self.map.split_off(key) }
940+
BTreeSet { map: self.map.split_off(value) }
941941
}
942942

943943
/// Creates an iterator that visits all values in ascending order and uses a closure

0 commit comments

Comments
 (0)