Skip to content

Commit b161cb5

Browse files
committed
Clarify text for add_braces assist
"to arm expression" is hard to parse, because "arm" can be a verb. Not all Rust users may know that "arm" refers to a `match` expression either. Tweak the wording to make the sentence easier to parse, and clarify that this assist refers to `match`. Use the same wording style for the closure version too.
1 parent 1925c25 commit b161cb5

File tree

1 file changed

+3
-3
lines changed
  • src/tools/rust-analyzer/crates/ide-assists/src/handlers

1 file changed

+3
-3
lines changed

src/tools/rust-analyzer/crates/ide-assists/src/handlers/add_braces.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::{AssistContext, AssistId, Assists};
77

88
// Assist: add_braces
99
//
10-
// Adds braces to lambda and match arm expressions.
10+
// Adds braces to closure bodies and match arm expressions.
1111
//
1212
// ```
1313
// fn foo(n: i32) -> i32 {
@@ -34,8 +34,8 @@ pub(crate) fn add_braces(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<(
3434
acc.add(
3535
AssistId::refactor_rewrite("add_braces"),
3636
match expr_type {
37-
ParentType::ClosureExpr => "Add braces to closure body",
38-
ParentType::MatchArmExpr => "Add braces to arm expression",
37+
ParentType::ClosureExpr => "Add braces to this closure body",
38+
ParentType::MatchArmExpr => "Add braces to this match arm expression",
3939
},
4040
expr.syntax().text_range(),
4141
|builder| {

0 commit comments

Comments
 (0)