Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/ast/edit_in_place.rs')
-rw-r--r--crates/syntax/src/ast/edit_in_place.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/syntax/src/ast/edit_in_place.rs b/crates/syntax/src/ast/edit_in_place.rs
index 660c057e99..d7ad4f332f 100644
--- a/crates/syntax/src/ast/edit_in_place.rs
+++ b/crates/syntax/src/ast/edit_in_place.rs
@@ -481,7 +481,7 @@ impl ast::AssocItemList {
},
};
let elements: Vec<SyntaxElement<_>> = vec![
- make::tokens::whitespace(&format!("{}{}", whitespace, indent)).into(),
+ make::tokens::whitespace(&format!("{whitespace}{indent}")).into(),
item.syntax().clone().into(),
];
ted::insert_all(position, elements);
@@ -537,7 +537,7 @@ impl ast::MatchArmList {
},
};
let indent = IndentLevel::from_node(self.syntax()) + 1;
- elements.push(make::tokens::whitespace(&format!("\n{}", indent)).into());
+ elements.push(make::tokens::whitespace(&format!("\n{indent}")).into());
elements.push(arm.syntax().clone().into());
if needs_comma(&arm) {
ted::append_child(arm.syntax(), make::token(SyntaxKind::COMMA));
@@ -555,7 +555,7 @@ impl ast::RecordExprFieldList {
let is_multiline = self.syntax().text().contains_char('\n');
let whitespace = if is_multiline {
let indent = IndentLevel::from_node(self.syntax()) + 1;
- make::tokens::whitespace(&format!("\n{}", indent))
+ make::tokens::whitespace(&format!("\n{indent}"))
} else {
make::tokens::single_space()
};
@@ -616,7 +616,7 @@ impl ast::RecordPatFieldList {
let is_multiline = self.syntax().text().contains_char('\n');
let whitespace = if is_multiline {
let indent = IndentLevel::from_node(self.syntax()) + 1;
- make::tokens::whitespace(&format!("\n{}", indent))
+ make::tokens::whitespace(&format!("\n{indent}"))
} else {
make::tokens::single_space()
};
@@ -681,7 +681,7 @@ impl ast::VariantList {
},
};
let elements: Vec<SyntaxElement<_>> = vec![
- make::tokens::whitespace(&format!("{}{}", "\n", indent)).into(),
+ make::tokens::whitespace(&format!("{}{indent}", "\n")).into(),
variant.syntax().clone().into(),
ast::make::token(T![,]).into(),
];
@@ -704,11 +704,11 @@ fn normalize_ws_between_braces(node: &SyntaxNode) -> Option<()> {
match l.next_sibling_or_token() {
Some(ws) if ws.kind() == SyntaxKind::WHITESPACE => {
if ws.next_sibling_or_token()?.into_token()? == r {
- ted::replace(ws, make::tokens::whitespace(&format!("\n{}", indent)));
+ ted::replace(ws, make::tokens::whitespace(&format!("\n{indent}")));
}
}
Some(ws) if ws.kind() == T!['}'] => {
- ted::insert(Position::after(l), make::tokens::whitespace(&format!("\n{}", indent)));
+ ted::insert(Position::after(l), make::tokens::whitespace(&format!("\n{indent}")));
}
_ => (),
}