Skip to content

Commit

Permalink
Add a doctest for BTreeSet::new.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbranchaud committed Dec 13, 2014
1 parent ffc1118 commit 58125e5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libcollections/btree/set.rs
Expand Up @@ -64,6 +64,14 @@ pub struct UnionItems<'a, T:'a> {

impl<T: Ord> BTreeSet<T> {
/// Makes a new BTreeSet with a reasonable choice of B.
///
/// # Examples
///
/// ```
/// use std::collections::BTreeSet;
///
/// let mut set: BTreeSet<int> = BTreeSet::new();
/// ```
#[unstable = "matches collection reform specification, waiting for dust to settle"]
pub fn new() -> BTreeSet<T> {
BTreeSet { map: BTreeMap::new() }
Expand Down

0 comments on commit 58125e5

Please sign in to comment.