Skip to content

Commit

Permalink
refactor(config): Open door for other mutable operations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Page committed Apr 7, 2021
1 parent 38a3007 commit 6729bf9
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,14 @@ impl<'s> ConfigEngine<'s> {

let walk = self.walk.intern(files);

let types = type_
.into_iter()
.map(|(type_, type_engine)| {
let mut new_type_engine = default.clone();
new_type_engine.update(&type_engine);
new_type_engine.update(&overrides);
let type_config = self.init_file_config(new_type_engine);
(type_, type_config)
})
.collect();
let mut types: std::collections::HashMap<_, _> = Default::default();
for (type_name, type_engine) in type_.into_iter() {
let mut new_type_engine = default.clone();
new_type_engine.update(&type_engine);
new_type_engine.update(&overrides);
let type_config = self.init_file_config(new_type_engine);
types.insert(type_name, type_config);
}
default.update(&overrides);
let default = self.init_file_config(default);

Expand Down

0 comments on commit 6729bf9

Please sign in to comment.