Skip to content

Commit 0e02522

Browse files
Merge #11874
11874: minor: enum variant wording r=Veykril a=jakevossen5 As discussed on Zulip: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/generate.20_.20for.20.22an.20enum.20variant.22 Co-authored-by: Jake Vossen <[email protected]>
2 parents ce8e028 + 93a8fcf commit 0e02522

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

crates/ide_assists/src/handlers/generate_enum_is_method.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::{
1010

1111
// Assist: generate_enum_is_method
1212
//
13-
// Generate an `is_` method for an enum variant.
13+
// Generate an `is_` method for this enum variant.
1414
//
1515
// ```
1616
// enum Version {
@@ -56,9 +56,9 @@ pub(crate) fn generate_enum_is_method(acc: &mut Assists, ctx: &AssistContext) ->
5656

5757
let target = variant.syntax().text_range();
5858
acc.add_group(
59-
&GroupLabel("Generate `is_`,`as_`,`try_into_`".to_owned()),
59+
&GroupLabel("Generate an `is_`,`as_`, or `try_into_` for this enum variant".to_owned()),
6060
AssistId("generate_enum_is_method", AssistKind::Generate),
61-
"Generate an `is_` method for an enum variant",
61+
"Generate an `is_` method for this enum variant",
6262
target,
6363
|builder| {
6464
let vis = parent_enum.visibility().map_or(String::new(), |v| format!("{} ", v));

crates/ide_assists/src/handlers/generate_enum_projection_method.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::{
1111

1212
// Assist: generate_enum_try_into_method
1313
//
14-
// Generate an `try_into_` method for an enum variant.
14+
// Generate a `try_into_` method for this enum variant.
1515
//
1616
// ```
1717
// enum Value {
@@ -41,7 +41,7 @@ pub(crate) fn generate_enum_try_into_method(acc: &mut Assists, ctx: &AssistConte
4141
acc,
4242
ctx,
4343
"generate_enum_try_into_method",
44-
"Generate an `try_into_` method for an enum variant",
44+
"Generate a `try_into_` method for this enum variant",
4545
ProjectionProps {
4646
fn_name_prefix: "try_into",
4747
self_param: "self",
@@ -55,7 +55,7 @@ pub(crate) fn generate_enum_try_into_method(acc: &mut Assists, ctx: &AssistConte
5555

5656
// Assist: generate_enum_as_method
5757
//
58-
// Generate an `as_` method for an enum variant.
58+
// Generate an `as_` method for this enum variant.
5959
//
6060
// ```
6161
// enum Value {
@@ -85,7 +85,7 @@ pub(crate) fn generate_enum_as_method(acc: &mut Assists, ctx: &AssistContext) ->
8585
acc,
8686
ctx,
8787
"generate_enum_as_method",
88-
"Generate an `as_` method for an enum variant",
88+
"Generate an `as_` method for this enum variant",
8989
ProjectionProps {
9090
fn_name_prefix: "as",
9191
self_param: "&self",
@@ -141,7 +141,7 @@ fn generate_enum_projection_method(
141141

142142
let target = variant.syntax().text_range();
143143
acc.add_group(
144-
&GroupLabel("Generate `is_`,`as_`,`try_into_`".to_owned()),
144+
&GroupLabel("Generate an `is_`,`as_`, or `try_into_` for this enum variant".to_owned()),
145145
AssistId(assist_id, AssistKind::Generate),
146146
assist_description,
147147
target,

crates/ide_assists/src/handlers/generate_from_impl_for_enum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::{utils::generate_trait_impl_text, AssistContext, AssistId, AssistKind
55

66
// Assist: generate_from_impl_for_enum
77
//
8-
// Adds a From impl for an enum variant with one tuple field.
8+
// Adds a From impl for this enum variant with one tuple field.
99
//
1010
// ```
1111
// enum A { $0One(u32) }

0 commit comments

Comments
 (0)