Unnamed repository; edit this file 'description' to name the repository.
rename set_path_with_editor to set_path
bit-aloo 5 weeks ago
parent a77f115 · commit db9a4db
-rw-r--r--crates/ide-assists/src/handlers/convert_let_else_to_match.rs2
-rw-r--r--crates/ide-assists/src/handlers/destructure_tuple_binding.rs6
-rw-r--r--crates/syntax/src/ast/edit.rs2
3 files changed, 3 insertions, 7 deletions
diff --git a/crates/ide-assists/src/handlers/convert_let_else_to_match.rs b/crates/ide-assists/src/handlers/convert_let_else_to_match.rs
index f32f9c633e..994fb44279 100644
--- a/crates/ide-assists/src/handlers/convert_let_else_to_match.rs
+++ b/crates/ide-assists/src/handlers/convert_let_else_to_match.rs
@@ -139,7 +139,7 @@ fn remove_mut_and_collect_idents(
p.name()?,
);
let non_mut_pat = if let Some(inner) = p.pat() {
- non_mut_pat.set_pat_with_editor(
+ non_mut_pat.set_pat(
remove_mut_and_collect_idents(make, editor, &inner, acc),
editor,
make,
diff --git a/crates/ide-assists/src/handlers/destructure_tuple_binding.rs b/crates/ide-assists/src/handlers/destructure_tuple_binding.rs
index 7e5df838d2..05fa00f4e8 100644
--- a/crates/ide-assists/src/handlers/destructure_tuple_binding.rs
+++ b/crates/ide-assists/src/handlers/destructure_tuple_binding.rs
@@ -226,11 +226,7 @@ impl AssignmentEdit {
fn apply(self, syntax_editor: &mut SyntaxEditor, syntax_mapping: &SyntaxFactory) {
// with sub_pattern: keep original tuple and add subpattern: `tup @ (_0, _1)`
if self.in_sub_pattern {
- self.ident_pat.set_pat_with_editor(
- Some(self.tuple_pat.into()),
- syntax_editor,
- syntax_mapping,
- );
+ self.ident_pat.set_pat(Some(self.tuple_pat.into()), syntax_editor, syntax_mapping);
} else if self.is_shorthand_field {
syntax_editor.insert(Position::after(self.ident_pat.syntax()), self.tuple_pat.syntax());
syntax_editor
diff --git a/crates/syntax/src/ast/edit.rs b/crates/syntax/src/ast/edit.rs
index c84da3202c..567bd09025 100644
--- a/crates/syntax/src/ast/edit.rs
+++ b/crates/syntax/src/ast/edit.rs
@@ -198,7 +198,7 @@ pub trait AstNodeEdit: AstNode + Clone + Sized {
impl<N: AstNode + Clone> AstNodeEdit for N {}
impl ast::IdentPat {
- pub fn set_pat_with_editor(
+ pub fn set_pat(
&self,
pat: Option<ast::Pat>,
syntax_editor: &mut SyntaxEditor,