Skip to content

Commit

Permalink
Merge pull request #37 from danielparks/clippy-default
Browse files Browse the repository at this point in the history
Fix clippy lint: `.or_default()`.
  • Loading branch information
danielparks authored Feb 2, 2024
2 parents b3f24dd + 4d5d29d commit bab0b38
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,8 @@ impl TreeNode {
key: K,
value: String,
) {
let node = key.fold(node, |node, &c| {
node.branch.entry(c).or_insert_with(TreeNode::default)
});
let node =
key.fold(node, |node, &c| node.branch.entry(c).or_default());
node.leaf = Some(value);
}
internal(self, key.into_iter(), value.into());
Expand Down

0 comments on commit bab0b38

Please sign in to comment.