From 6799895b6d08e2b3be41a13b74b78368e4f08945 Mon Sep 17 00:00:00 2001 From: Nathan Kleyn Date: Wed, 9 Mar 2016 16:39:23 +0000 Subject: [PATCH] Add missing "basic usage" sections to docs, fix review comments. --- src/libcollections/btree/map.rs | 37 ++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index 107a9d415a5..47518d8b33d 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -347,10 +347,15 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// - /// let mut map: BTreeMap<&str, isize> = BTreeMap::new(); + /// let mut map = BTreeMap::new(); + /// + /// // entries can now be inserted into the empty map + /// a.insert(1, "a"); /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn new() -> BTreeMap { @@ -364,6 +369,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// @@ -385,6 +392,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// @@ -408,6 +417,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// @@ -428,6 +439,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// @@ -460,6 +473,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// @@ -490,6 +505,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// @@ -519,6 +536,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// #![feature(btree_range, collections_bound)] /// @@ -592,6 +611,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// #![feature(btree_range, collections_bound)] /// @@ -667,6 +688,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// @@ -1275,6 +1298,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// @@ -1305,6 +1330,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// @@ -1338,6 +1365,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// @@ -1357,6 +1386,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// @@ -1376,6 +1407,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; /// @@ -1393,6 +1426,8 @@ impl BTreeMap { /// /// # Examples /// + /// Basic usage: + /// /// ``` /// use std::collections::BTreeMap; ///