Skip to content

Commit

Permalink
Make BTreeSet::split_off name elements like other set methods do
Browse files Browse the repository at this point in the history
  • Loading branch information
ssomers committed Jul 12, 2021
1 parent ce9c138 commit f3305c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions collections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,8 @@ impl<T> BTreeSet<T> {
self.map.append(&mut other.map);
}

/// Splits the collection into two at the given key. Returns everything after the given key,
/// including the key.
/// Splits the collection into two at the given value. Returns everything after the given value,
/// including the value.
///
/// # Examples
///
Expand Down Expand Up @@ -933,11 +933,11 @@ impl<T> BTreeSet<T> {
/// assert!(b.contains(&41));
/// ```
#[stable(feature = "btree_split_off", since = "1.11.0")]
pub fn split_off<Q: ?Sized + Ord>(&mut self, key: &Q) -> Self
pub fn split_off<Q: ?Sized + Ord>(&mut self, value: &Q) -> Self
where
T: Borrow<Q> + Ord,
{
BTreeSet { map: self.map.split_off(key) }
BTreeSet { map: self.map.split_off(value) }
}

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

0 comments on commit f3305c3

Please sign in to comment.