Add a doctest for BTreeSet::new.

This commit is contained in:
jbranchaud 2014-12-12 22:09:40 -06:00
parent ffc111889e
commit 58125e5433

View file

@ -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() }