Skip to content

Commit 6799895

Browse files
committed
Add missing "basic usage" sections to docs, fix review comments.
1 parent a8df890 commit 6799895

File tree

1 file changed

+36
-1
lines changed
  • src/libcollections/btree

1 file changed

+36
-1
lines changed

src/libcollections/btree/map.rs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,15 @@ impl<K: Ord, V> BTreeMap<K, V> {
347347
///
348348
/// # Examples
349349
///
350+
/// Basic usage:
351+
///
350352
/// ```
351353
/// use std::collections::BTreeMap;
352354
///
353-
/// let mut map: BTreeMap<&str, isize> = BTreeMap::new();
355+
/// let mut map = BTreeMap::new();
356+
///
357+
/// // entries can now be inserted into the empty map
358+
/// a.insert(1, "a");
354359
/// ```
355360
#[stable(feature = "rust1", since = "1.0.0")]
356361
pub fn new() -> BTreeMap<K, V> {
@@ -364,6 +369,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
364369
///
365370
/// # Examples
366371
///
372+
/// Basic usage:
373+
///
367374
/// ```
368375
/// use std::collections::BTreeMap;
369376
///
@@ -385,6 +392,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
385392
///
386393
/// # Examples
387394
///
395+
/// Basic usage:
396+
///
388397
/// ```
389398
/// use std::collections::BTreeMap;
390399
///
@@ -408,6 +417,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
408417
///
409418
/// # Examples
410419
///
420+
/// Basic usage:
421+
///
411422
/// ```
412423
/// use std::collections::BTreeMap;
413424
///
@@ -428,6 +439,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
428439
///
429440
/// # Examples
430441
///
442+
/// Basic usage:
443+
///
431444
/// ```
432445
/// use std::collections::BTreeMap;
433446
///
@@ -460,6 +473,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
460473
///
461474
/// # Examples
462475
///
476+
/// Basic usage:
477+
///
463478
/// ```
464479
/// use std::collections::BTreeMap;
465480
///
@@ -490,6 +505,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
490505
///
491506
/// # Examples
492507
///
508+
/// Basic usage:
509+
///
493510
/// ```
494511
/// use std::collections::BTreeMap;
495512
///
@@ -519,6 +536,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
519536
///
520537
/// # Examples
521538
///
539+
/// Basic usage:
540+
///
522541
/// ```
523542
/// #![feature(btree_range, collections_bound)]
524543
///
@@ -592,6 +611,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
592611
///
593612
/// # Examples
594613
///
614+
/// Basic usage:
615+
///
595616
/// ```
596617
/// #![feature(btree_range, collections_bound)]
597618
///
@@ -667,6 +688,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
667688
///
668689
/// # Examples
669690
///
691+
/// Basic usage:
692+
///
670693
/// ```
671694
/// use std::collections::BTreeMap;
672695
///
@@ -1275,6 +1298,8 @@ impl<K, V> BTreeMap<K, V> {
12751298
///
12761299
/// # Examples
12771300
///
1301+
/// Basic usage:
1302+
///
12781303
/// ```
12791304
/// use std::collections::BTreeMap;
12801305
///
@@ -1305,6 +1330,8 @@ impl<K, V> BTreeMap<K, V> {
13051330
///
13061331
/// # Examples
13071332
///
1333+
/// Basic usage:
1334+
///
13081335
/// ```
13091336
/// use std::collections::BTreeMap;
13101337
///
@@ -1338,6 +1365,8 @@ impl<K, V> BTreeMap<K, V> {
13381365
///
13391366
/// # Examples
13401367
///
1368+
/// Basic usage:
1369+
///
13411370
/// ```
13421371
/// use std::collections::BTreeMap;
13431372
///
@@ -1357,6 +1386,8 @@ impl<K, V> BTreeMap<K, V> {
13571386
///
13581387
/// # Examples
13591388
///
1389+
/// Basic usage:
1390+
///
13601391
/// ```
13611392
/// use std::collections::BTreeMap;
13621393
///
@@ -1376,6 +1407,8 @@ impl<K, V> BTreeMap<K, V> {
13761407
///
13771408
/// # Examples
13781409
///
1410+
/// Basic usage:
1411+
///
13791412
/// ```
13801413
/// use std::collections::BTreeMap;
13811414
///
@@ -1393,6 +1426,8 @@ impl<K, V> BTreeMap<K, V> {
13931426
///
13941427
/// # Examples
13951428
///
1429+
/// Basic usage:
1430+
///
13961431
/// ```
13971432
/// use std::collections::BTreeMap;
13981433
///

0 commit comments

Comments
 (0)