Skip to content

Commit

Permalink
fixed json test
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Power committed Jan 3, 2017
1 parent 229f2a3 commit f6871e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions src/language/languages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,17 @@ impl Languages {

#[cfg(feature = "io")]
fn from_previous(map: BTreeMap<LanguageType, Language>) -> Self {
use std::collections::btree_map::Entry::*;
let mut _self = Self::new();

for (name, input_language) in map {
if let Some(language) = _self.get_mut(&name) {
*language += input_language;
match _self.entry(name) {
Occupied(mut entry) => {
*entry.get_mut() += input_language;
}
Vacant(entry) => {
entry.insert(input_language);
}
}
}
_self
Expand Down

0 comments on commit f6871e1

Please sign in to comment.