Skip to content

Commit f1ed576

Browse files
garethgareth
authored andcommitted
---
yaml --- r: 65534 b: refs/heads/master c: d443fc6 h: refs/heads/master v: v3
1 parent a90ea65 commit f1ed576

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: c354a0c7eb22f7a4bc1c7adf8e2ed34ee96428aa
2+
refs/heads/master: d443fc6d90577003724ce128d2c07b7ad6b347c9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libstd/hashmap.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,15 @@ impl<K: Hash + Eq, V> HashMap<K, V> {
501501
}
502502
}
503503

504+
/// Retrieves a (mutable) value for the given key, failing if the key
505+
/// is not present.
506+
pub fn get_mut<'a>(&'a mut self, k: &K) -> &'a mut V {
507+
match self.find_mut(k) {
508+
Some(v) => v,
509+
None => fail!("No entry found for key: %?", k),
510+
}
511+
}
512+
504513
/// Return true if the map contains a value for the specified key,
505514
/// using equivalence
506515
pub fn contains_key_equiv<Q:Hash + Equiv<K>>(&self, key: &Q) -> bool {

0 commit comments

Comments
 (0)