Skip to content

Commit 00bdae0

Browse files
committed
Avoid weird or_insert_with example
1 parent 35c7943 commit 00bdae0

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/liballoc/btree/map.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -2116,9 +2116,7 @@ impl<'a, K: Ord, V: Default> Entry<'a, K, V> {
21162116
/// # fn main() {
21172117
/// use std::collections::BTreeMap;
21182118
///
2119-
/// let mut map: BTreeMap<&str, String> = BTreeMap::new();
2120-
/// let s = "hoho".to_string();
2121-
///
2119+
/// let mut map: BTreeMap<&str, Option<usize>> = BTreeMap::new();
21222120
/// map.entry("poneyland").or_default();
21232121
///
21242122
/// assert_eq!(map["poneyland"], None);

src/libstd/collections/hash/map.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -2013,9 +2013,7 @@ impl<'a, K, V: Default> Entry<'a, K, V> {
20132013
/// # fn main() {
20142014
/// use std::collections::HashMap;
20152015
///
2016-
/// let mut map: HashMap<&str, Option<usize>> = HashMap::new();
2017-
/// let s = "hoho".to_string();
2018-
///
2016+
/// let mut map: HashMap<&str, Option<u32>> = HashMap::new();
20192017
/// map.entry("poneyland").or_default();
20202018
///
20212019
/// assert_eq!(map["poneyland"], None);

0 commit comments

Comments
 (0)