From 2c82a1aec71e858040f24d4b39d3937c737f1ef5 Mon Sep 17 00:00:00 2001 From: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> Date: Tue, 15 Dec 2020 21:35:41 +0100 Subject: generate default implementation for an enum from an enum variant #6860 Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> --- .../src/handlers/generate_default_from_enum_variant.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'crates') diff --git a/crates/assists/src/handlers/generate_default_from_enum_variant.rs b/crates/assists/src/handlers/generate_default_from_enum_variant.rs index 5f6885710..bcea46735 100644 --- a/crates/assists/src/handlers/generate_default_from_enum_variant.rs +++ b/crates/assists/src/handlers/generate_default_from_enum_variant.rs @@ -105,7 +105,8 @@ mod tests { fn test_generate_default_from_variant() { check_assist( generate_default_from_enum_variant, - r#"enum Variant { + r#" +enum Variant { Undefined, Minor<|>, Major, @@ -128,7 +129,8 @@ impl Default for Variant { fn test_generate_default_already_implemented() { mark::check!(test_gen_default_impl_already_exists); check_not_applicable( - r#"enum Variant { + r#" +enum Variant { Undefined, Minor<|>, Major, @@ -146,7 +148,8 @@ impl Default for Variant { fn test_add_from_impl_no_element() { mark::check!(test_gen_default_on_non_unit_variant_not_implemented); check_not_applicable( - r#"enum Variant { + r#" +enum Variant { Undefined, Minor(u32)<|>, Major, @@ -159,7 +162,8 @@ impl Default for Variant { check_assist( generate_default_from_enum_variant, r#"enum Variant { Undefi<|>ned }"#, - r#"enum Variant { Undefined } + r#" +enum Variant { Undefined } impl Default for Variant { fn default() -> Self { -- cgit v1.2.3