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 <jake@vossen.dev>
This commit is contained in:
bors[bot] 2022-04-01 21:30:32 +00:00 committed by GitHub
commit 0e02522b1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -10,7 +10,7 @@
// Assist: generate_enum_is_method
//
// Generate an `is_` method for an enum variant.
// Generate an `is_` method for this enum variant.
//
// ```
// enum Version {
@ -56,9 +56,9 @@ pub(crate) fn generate_enum_is_method(acc: &mut Assists, ctx: &AssistContext) ->
let target = variant.syntax().text_range();
acc.add_group(
&GroupLabel("Generate `is_`,`as_`,`try_into_`".to_owned()),
&GroupLabel("Generate an `is_`,`as_`, or `try_into_` for this enum variant".to_owned()),
AssistId("generate_enum_is_method", AssistKind::Generate),
"Generate an `is_` method for an enum variant",
"Generate an `is_` method for this enum variant",
target,
|builder| {
let vis = parent_enum.visibility().map_or(String::new(), |v| format!("{} ", v));

View File

@ -11,7 +11,7 @@
// Assist: generate_enum_try_into_method
//
// Generate an `try_into_` method for an enum variant.
// Generate a `try_into_` method for this enum variant.
//
// ```
// enum Value {
@ -41,7 +41,7 @@ pub(crate) fn generate_enum_try_into_method(acc: &mut Assists, ctx: &AssistConte
acc,
ctx,
"generate_enum_try_into_method",
"Generate an `try_into_` method for an enum variant",
"Generate a `try_into_` method for this enum variant",
ProjectionProps {
fn_name_prefix: "try_into",
self_param: "self",
@ -55,7 +55,7 @@ pub(crate) fn generate_enum_try_into_method(acc: &mut Assists, ctx: &AssistConte
// Assist: generate_enum_as_method
//
// Generate an `as_` method for an enum variant.
// Generate an `as_` method for this enum variant.
//
// ```
// enum Value {
@ -85,7 +85,7 @@ pub(crate) fn generate_enum_as_method(acc: &mut Assists, ctx: &AssistContext) ->
acc,
ctx,
"generate_enum_as_method",
"Generate an `as_` method for an enum variant",
"Generate an `as_` method for this enum variant",
ProjectionProps {
fn_name_prefix: "as",
self_param: "&self",
@ -141,7 +141,7 @@ fn generate_enum_projection_method(
let target = variant.syntax().text_range();
acc.add_group(
&GroupLabel("Generate `is_`,`as_`,`try_into_`".to_owned()),
&GroupLabel("Generate an `is_`,`as_`, or `try_into_` for this enum variant".to_owned()),
AssistId(assist_id, AssistKind::Generate),
assist_description,
target,

View File

@ -5,7 +5,7 @@
// Assist: generate_from_impl_for_enum
//
// Adds a From impl for an enum variant with one tuple field.
// Adds a From impl for this enum variant with one tuple field.
//
// ```
// enum A { $0One(u32) }