1
Fork 0

update everything to use Entry defaults

This commit is contained in:
Alexis 2015-03-01 09:42:11 -05:00
parent 1c35953cf8
commit 93cdf1f278
12 changed files with 24 additions and 84 deletions

View file

@ -352,9 +352,7 @@ fn parse_externs(matches: &getopts::Matches) -> Result<core::Externs, String> {
}
};
let name = name.to_string();
let locs = externs.entry(name).get().unwrap_or_else(
|vacant_entry| vacant_entry.insert(Vec::with_capacity(1)));
locs.push(location.to_string());
externs.entry(name).default(vec![]).push(location.to_string());
}
Ok(externs)
}