Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
langston-barrett committed Oct 27, 2023
1 parent 423352f commit 13895d3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/mogglo/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ pub struct Env<'tree>(pub(crate) HashMap<Metavar, HashSet<Node<'tree>>>);
impl<'tree> Env<'tree> {
pub fn extend(&mut self, env: Env<'tree>) {
for (mvar, bindings) in env.0 {
self.0
.entry(mvar)
.or_insert_with(HashSet::new)
.extend(bindings);
self.0.entry(mvar).or_default().extend(bindings);
}
}

pub fn insert(&mut self, mvar: Metavar, node: Node<'tree>) {
self.0.entry(mvar).or_insert_with(HashSet::new).insert(node);
self.0.entry(mvar).or_default().insert(node);
}
}

0 comments on commit 13895d3

Please sign in to comment.