From 68d003c9baab1435c7dd65006a2ffa11c3dbe17a Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Sat, 18 Apr 2015 12:45:05 -0400 Subject: Utilize if..let for get_mut doc-comment examples --- src/libstd/collections/hash/map.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 9b93066f9fb..4ac15b7991b 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -1094,9 +1094,8 @@ impl HashMap /// /// let mut map = HashMap::new(); /// map.insert(1, "a"); - /// match map.get_mut(&1) { - /// Some(x) => *x = "b", - /// None => (), + /// if let Some(x) = map.get_mut(&1) { + /// *x = "b"; /// } /// assert_eq!(map[&1], "b"); /// ``` -- cgit 1.4.1-3-g733a5