]> git.lizzy.rs Git - rust.git/commitdiff
Add a doctest for BTreeSet::new.
authorjbranchaud <jbranchaud@gmail.com>
Sat, 13 Dec 2014 04:09:40 +0000 (22:09 -0600)
committerjbranchaud <jbranchaud@gmail.com>
Sat, 13 Dec 2014 04:09:40 +0000 (22:09 -0600)
src/libcollections/btree/set.rs

index 0fbc319f4ff645f18e610600fd156f768b50c03b..f02b1d3f3adb3afde1f73697c1b65c362cccfabe 100644 (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() }