Skip to content

Commit

Permalink
fix doctests for BTreeSet to use BTreeSet (not BTreeMap)
Browse files Browse the repository at this point in the history
This fixes #47624
  • Loading branch information
astraw committed Jan 20, 2018
1 parent 15a1e28 commit 4d08d05
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/liballoc/btree/set.rs
Expand Up @@ -658,26 +658,26 @@ impl<T: Ord> BTreeSet<T> {
/// Basic usage:
///
/// ```
/// use std::collections::BTreeMap;
/// use std::collections::BTreeSet;
///
/// let mut a = BTreeMap::new();
/// a.insert(1, "a");
/// a.insert(2, "b");
/// a.insert(3, "c");
/// a.insert(17, "d");
/// a.insert(41, "e");
/// let mut a = BTreeSet::new();
/// a.insert(1);
/// a.insert(2);
/// a.insert(3);
/// a.insert(17);
/// a.insert(41);
///
/// let b = a.split_off(&3);
///
/// assert_eq!(a.len(), 2);
/// assert_eq!(b.len(), 3);
///
/// assert_eq!(a[&1], "a");
/// assert_eq!(a[&2], "b");
/// assert!(a.contains(&1));
/// assert!(a.contains(&2));
///
/// assert_eq!(b[&3], "c");
/// assert_eq!(b[&17], "d");
/// assert_eq!(b[&41], "e");
/// assert!(b.contains(&3));
/// assert!(b.contains(&17));
/// 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 where T: Borrow<Q> {
Expand Down

0 comments on commit 4d08d05

Please sign in to comment.