diff options
| author | Alexis <a.beingessner@gmail.com> | 2015-03-01 09:42:11 -0500 |
|---|---|---|
| committer | Alexis <a.beingessner@gmail.com> | 2015-03-26 21:36:06 -0400 |
| commit | 93cdf1f2783e3a863929a5ef2032e7de752e4e40 (patch) | |
| tree | 33639adfd0d7c50b42528a196cdeaa6c4ee18845 /src/librustc/session | |
| parent | 1c35953cf8baa2e721401ba6354f0bd9a9f2abaf (diff) | |
| download | rust-93cdf1f2783e3a863929a5ef2032e7de752e4e40.tar.gz rust-93cdf1f2783e3a863929a5ef2032e7de752e4e40.zip | |
update everything to use Entry defaults
Diffstat (limited to 'src/librustc/session')
| -rw-r--r-- | src/librustc/session/config.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index a7c67a08631..5f0ab104885 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -35,7 +35,6 @@ use syntax::parse::token::InternedString; use getopts; use std::collections::HashMap; -use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::env; use std::fmt; use std::path::PathBuf; @@ -1037,10 +1036,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options { None => early_error("--extern value must be of the format `foo=bar`"), }; - match externs.entry(name.to_string()) { - Vacant(entry) => { entry.insert(vec![location.to_string()]); }, - Occupied(mut entry) => { entry.get_mut().push(location.to_string()); }, - } + externs.entry(name.to_string()).default(vec![]).push(location.to_string()); } let crate_name = matches.opt_str("crate-name"); |
