Avoid weird or_insert_with example
This commit is contained in:
parent
35c7943fd2
commit
00bdae02fd
2 changed files with 2 additions and 6 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue