Skip to content

Commit c5c07c2

Browse files
bors[bot]matklad
andauthored
Merge #4388
4388: unindent -> dedent r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 parents 5af66e5 + 5c04d85 commit c5c07c2

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

crates/ra_assists/src/handlers/early_return.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub(crate) fn convert_to_guarded_return(acc: &mut Assists, ctx: &AssistContext)
156156
parent_block: &ast::BlockExpr,
157157
if_expr: &ast::IfExpr,
158158
) -> SyntaxNode {
159-
let then_block_items = then_block.unindent(IndentLevel::from(1));
159+
let then_block_items = then_block.dedent(IndentLevel::from(1));
160160
let end_of_then = then_block_items.syntax().last_child_or_token().unwrap();
161161
let end_of_then =
162162
if end_of_then.prev_sibling_or_token().map(|n| n.kind()) == Some(WHITESPACE) {

crates/ra_syntax/src/ast/edit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ pub trait AstNodeEdit: AstNode + Clone + Sized {
555555
Self::cast(indent.increase_indent(self.syntax().clone())).unwrap()
556556
}
557557
#[must_use]
558-
fn unindent(&self, indent: IndentLevel) -> Self {
558+
fn dedent(&self, indent: IndentLevel) -> Self {
559559
Self::cast(indent.decrease_indent(self.syntax().clone())).unwrap()
560560
}
561561
}

crates/test_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ fn parse_fixture_checks_further_indented_metadata() {
270270
}
271271

272272
#[test]
273-
fn parse_fixture_can_handle_unindented_first_line() {
273+
fn parse_fixture_can_handle_dedented_first_line() {
274274
let fixture = "//- /lib.rs
275275
mod foo;
276276
//- /foo.rs

0 commit comments

Comments
 (0)