diff options
-rw-r--r-- | crates/ra_assists/src/handlers/early_return.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/edit.rs | 2 | ||||
-rw-r--r-- | crates/test_utils/src/lib.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/handlers/early_return.rs b/crates/ra_assists/src/handlers/early_return.rs index 0f2914950..66b296081 100644 --- a/crates/ra_assists/src/handlers/early_return.rs +++ b/crates/ra_assists/src/handlers/early_return.rs | |||
@@ -156,7 +156,7 @@ pub(crate) fn convert_to_guarded_return(acc: &mut Assists, ctx: &AssistContext) | |||
156 | parent_block: &ast::BlockExpr, | 156 | parent_block: &ast::BlockExpr, |
157 | if_expr: &ast::IfExpr, | 157 | if_expr: &ast::IfExpr, |
158 | ) -> SyntaxNode { | 158 | ) -> SyntaxNode { |
159 | let then_block_items = then_block.unindent(IndentLevel::from(1)); | 159 | let then_block_items = then_block.dedent(IndentLevel::from(1)); |
160 | let end_of_then = then_block_items.syntax().last_child_or_token().unwrap(); | 160 | let end_of_then = then_block_items.syntax().last_child_or_token().unwrap(); |
161 | let end_of_then = | 161 | let end_of_then = |
162 | if end_of_then.prev_sibling_or_token().map(|n| n.kind()) == Some(WHITESPACE) { | 162 | if end_of_then.prev_sibling_or_token().map(|n| n.kind()) == Some(WHITESPACE) { |
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index 94dfb1a13..24a1e1d91 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs | |||
@@ -555,7 +555,7 @@ pub trait AstNodeEdit: AstNode + Clone + Sized { | |||
555 | Self::cast(indent.increase_indent(self.syntax().clone())).unwrap() | 555 | Self::cast(indent.increase_indent(self.syntax().clone())).unwrap() |
556 | } | 556 | } |
557 | #[must_use] | 557 | #[must_use] |
558 | fn unindent(&self, indent: IndentLevel) -> Self { | 558 | fn dedent(&self, indent: IndentLevel) -> Self { |
559 | Self::cast(indent.decrease_indent(self.syntax().clone())).unwrap() | 559 | Self::cast(indent.decrease_indent(self.syntax().clone())).unwrap() |
560 | } | 560 | } |
561 | } | 561 | } |
diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs index b13e13af2..b1e3c328f 100644 --- a/crates/test_utils/src/lib.rs +++ b/crates/test_utils/src/lib.rs | |||
@@ -270,7 +270,7 @@ fn parse_fixture_checks_further_indented_metadata() { | |||
270 | } | 270 | } |
271 | 271 | ||
272 | #[test] | 272 | #[test] |
273 | fn parse_fixture_can_handle_unindented_first_line() { | 273 | fn parse_fixture_can_handle_dedented_first_line() { |
274 | let fixture = "//- /lib.rs | 274 | let fixture = "//- /lib.rs |
275 | mod foo; | 275 | mod foo; |
276 | //- /foo.rs | 276 | //- /foo.rs |