From fee05b0491a71775c4319ce8f76641382f840770 Mon Sep 17 00:00:00 2001 From: Domantas Jadenkus Date: Sat, 13 Feb 2021 14:27:38 +0200 Subject: [PATCH] use Self instead of enum name --- .../src/handlers/generate_from_impl_for_enum.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/assists/src/handlers/generate_from_impl_for_enum.rs b/crates/assists/src/handlers/generate_from_impl_for_enum.rs index d9af6ab1178..71897e6ebbc 100644 --- a/crates/assists/src/handlers/generate_from_impl_for_enum.rs +++ b/crates/assists/src/handlers/generate_from_impl_for_enum.rs @@ -56,7 +56,7 @@ pub(crate) fn generate_from_impl_for_enum(acc: &mut Assists, ctx: &AssistContext impl From<{0}> for {1} {{ fn from(v: {0}) -> Self {{ - {1}::{2}(v) + Self::{2}(v) }} }}"#, path.syntax(), @@ -106,7 +106,7 @@ fn test_generate_from_impl_for_enum() { impl From for A { fn from(v: u32) -> Self { - A::One(v) + Self::One(v) } }"#, ); @@ -121,7 +121,7 @@ fn test_generate_from_impl_for_enum_complicated_path() { impl From for A { fn from(v: foo::bar::baz::Boo) -> Self { - A::One(v) + Self::One(v) } }"#, ); @@ -157,7 +157,7 @@ enum A { $0One(u32), } impl From for A { fn from(v: u32) -> Self { - A::One(v) + Self::One(v) } } "#, @@ -183,7 +183,7 @@ pub trait From { impl From for A { fn from(v: u32) -> Self { - A::One(v) + Self::One(v) } }