From 22158cb71a728aee4773d8aa4a4545673e7f8393 Mon Sep 17 00:00:00 2001 From: James Prestwich Date: Fri, 2 Apr 2021 11:39:56 -0700 Subject: [PATCH] lint: another from impl --- rust/kathy/src/settings.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rust/kathy/src/settings.rs b/rust/kathy/src/settings.rs index 6a00130e0..87eec39c8 100644 --- a/rust/kathy/src/settings.rs +++ b/rust/kathy/src/settings.rs @@ -30,10 +30,10 @@ impl Default for ChatGenConfig { } } -impl Into for ChatGenConfig { - fn into(self) -> ChatGenerator { - match self { - Self::Static { +impl From for ChatGenerator { + fn from(conf: ChatGenConfig) -> ChatGenerator { + match conf { + ChatGenConfig::Static { destination, recipient, message, @@ -42,12 +42,12 @@ impl Into for ChatGenConfig { recipient, message, }, - Self::OrderedList { messages } => ChatGenerator::OrderedList { + ChatGenConfig::OrderedList { messages } => ChatGenerator::OrderedList { messages, counter: 0, }, - Self::Random { length } => ChatGenerator::Random { length }, - Self::Default => ChatGenerator::Default, + ChatGenConfig::Random { length } => ChatGenerator::Random { length }, + ChatGenConfig::Default => ChatGenerator::Default, } } }