Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/algo.rs')
-rw-r--r--crates/syntax/src/algo.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/syntax/src/algo.rs b/crates/syntax/src/algo.rs
index c402a7bcea..c4548b1647 100644
--- a/crates/syntax/src/algo.rs
+++ b/crates/syntax/src/algo.rs
@@ -207,7 +207,7 @@ pub fn diff(from: &SyntaxNode, to: &SyntaxNode) -> TreeDiff {
TreeDiffInsertPos::AsFirstChild(lhs.clone().into())
}
};
- diff.insertions.entry(insert_pos).or_insert_with(Vec::new).push(element);
+ diff.insertions.entry(insert_pos).or_default().push(element);
}
(Some(element), None) => {
cov_mark::hit!(diff_delete);
@@ -239,7 +239,7 @@ pub fn diff(from: &SyntaxNode, to: &SyntaxNode) -> TreeDiff {
TreeDiffInsertPos::AsFirstChild(lhs.clone().into())
};
- diff.insertions.entry(insert_pos).or_insert_with(Vec::new).extend(drain);
+ diff.insertions.entry(insert_pos).or_default().extend(drain);
rhs_children = rhs_children_clone;
} else {
go(diff, lhs_ele, rhs_ele);