]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #47578 - arthurprs:btree-doc, r=alexcrichton
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 20 Jan 2018 21:32:50 +0000 (22:32 +0100)
committerGitHub <noreply@github.com>
Sat, 20 Jan 2018 21:32:50 +0000 (22:32 +0100)
Update BTreeMap recommendation

Focus on the ordering / range(instead of all) benefit as it's the most important feature.

src/libstd/collections/mod.rs

index b8a6a66eaa65d60201d107319749cc7336af40a6..e9a150f34a51efdc31afe6b251d0ec780150a2fa 100644 (file)
 //! * You want a map, with no extra functionality.
 //!
 //! ### Use a `BTreeMap` when:
+//! * You want a map sorted by its keys.
+//! * You want to be able to get a range of entries on-demand.
 //! * You're interested in what the smallest or largest key-value pair is.
 //! * You want to find the largest or smallest key that is smaller or larger
 //!   than something.
-//! * You want to be able to get all of the entries in order on-demand.
-//! * You want a map sorted by its keys.
 //!
 //! ### Use the `Set` variant of any of these `Map`s when:
 //! * You just want to remember which keys you've seen.