diff options
| author | Jon Gjengset <jon@thesquareplanet.com> | 2017-09-05 13:37:36 -0400 |
|---|---|---|
| committer | Jon Gjengset <jon@thesquareplanet.com> | 2017-09-05 13:37:36 -0400 |
| commit | 00bdae02fdbb2e27e4d27a54683537faa33b3f17 (patch) | |
| tree | 1166791c5cdd6cf9abbe9a624d96f926eced84dc /src/liballoc | |
| parent | 35c7943fd2d2a65b63712d95d62c8837633218b4 (diff) | |
| download | rust-00bdae02fdbb2e27e4d27a54683537faa33b3f17.tar.gz rust-00bdae02fdbb2e27e4d27a54683537faa33b3f17.zip | |
Avoid weird or_insert_with example
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/btree/map.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/liballoc/btree/map.rs b/src/liballoc/btree/map.rs index 0adfaf3be8f..4c93fead172 100644 --- a/src/liballoc/btree/map.rs +++ b/src/liballoc/btree/map.rs @@ -2116,9 +2116,7 @@ impl<'a, K: Ord, V: Default> Entry<'a, K, V> { /// # fn main() { /// use std::collections::BTreeMap; /// - /// let mut map: BTreeMap<&str, String> = BTreeMap::new(); - /// let s = "hoho".to_string(); - /// + /// let mut map: BTreeMap<&str, Option<usize>> = BTreeMap::new(); /// map.entry("poneyland").or_default(); /// /// assert_eq!(map["poneyland"], None); |
