Implement Index for HashMap

This also deprecates HashMap::get. Use indexing instead.
This commit is contained in:
P1start
2014-08-02 18:48:44 +12:00
parent fd10d209cd
commit 32f5898bea
4 changed files with 57 additions and 15 deletions

View File

@@ -1252,8 +1252,8 @@ impl<'a> Item<'a> {
// located, then we return `None`.
} else {
let cache = cache_key.get().unwrap();
let path = cache.external_paths.get(&self.item.def_id);
let root = match *cache.extern_locations.get(&self.item.def_id.krate) {
let path = &cache.external_paths[self.item.def_id];
let root = match cache.extern_locations[self.item.def_id.krate] {
Remote(ref s) => s.to_string(),
Local => self.cx.root_path.clone(),
Unknown => return None,