From eb23af9e73af40a535b866a970c0c09ea4287e52 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Fri, 25 Apr 2025 22:15:22 -0700 Subject: [PATCH] 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. --- crates/ide-assists/src/handlers/add_braces.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ide-assists/src/handlers/add_braces.rs b/crates/ide-assists/src/handlers/add_braces.rs index 38d80ca606..745ae67f30 100644 --- a/crates/ide-assists/src/handlers/add_braces.rs +++ b/crates/ide-assists/src/handlers/add_braces.rs @@ -7,7 +7,7 @@ use crate::{AssistContext, AssistId, Assists}; // Assist: add_braces // -// Adds braces to lambda and match arm expressions. +// Adds braces to closure bodies and match arm expressions. // // ``` // fn foo(n: i32) -> i32 { @@ -34,8 +34,8 @@ pub(crate) fn add_braces(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<( acc.add( AssistId::refactor_rewrite("add_braces"), match expr_type { - ParentType::ClosureExpr => "Add braces to closure body", - ParentType::MatchArmExpr => "Add braces to arm expression", + ParentType::ClosureExpr => "Add braces to this closure body", + ParentType::MatchArmExpr => "Add braces to this match arm expression", }, expr.syntax().text_range(), |builder| {