Format BtreeMap::range_mut example

This commit is contained in:
kngwyu 2018-11-06 15:34:03 +09:00
parent 8aa926729e
commit 1224e0197a

View File

@ -853,9 +853,10 @@ pub fn range<T: ?Sized, R>(&self, range: R) -> Range<K, V>
/// ```
/// use std::collections::BTreeMap;
///
/// let mut map: BTreeMap<&str, i32> = ["Alice", "Bob", "Carol", "Cheryl"].iter()
/// .map(|&s| (s, 0))
/// .collect();
/// let mut map: BTreeMap<&str, i32> = ["Alice", "Bob", "Carol", "Cheryl"]
/// .iter()
/// .map(|&s| (s, 0))
/// .collect();
/// for (_, balance) in map.range_mut("B".."Cheryl") {
/// *balance += 100;
/// }