From adce7a4773abe766996698d74d93630a969d6249 Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Tue, 28 Jul 2020 23:33:53 +0600 Subject: [PATCH] Remove the smart-default dependency from examples/redis_remember_bot --- examples/redis_remember_bot/Cargo.toml | 1 - examples/redis_remember_bot/src/main.rs | 2 -- examples/redis_remember_bot/src/states.rs | 11 ++++++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/redis_remember_bot/Cargo.toml b/examples/redis_remember_bot/Cargo.toml index 6ddd2f44..12e62055 100644 --- a/examples/redis_remember_bot/Cargo.toml +++ b/examples/redis_remember_bot/Cargo.toml @@ -15,5 +15,4 @@ serde = "1.0.104" futures = "0.3.5" thiserror = "1.0.15" -smart-default = "0.6.0" derive_more = "0.99.9" diff --git a/examples/redis_remember_bot/src/main.rs b/examples/redis_remember_bot/src/main.rs index 6dd8536d..08f77db9 100644 --- a/examples/redis_remember_bot/src/main.rs +++ b/examples/redis_remember_bot/src/main.rs @@ -1,6 +1,4 @@ #[macro_use] -extern crate smart_default; -#[macro_use] extern crate derive_more; mod states; diff --git a/examples/redis_remember_bot/src/states.rs b/examples/redis_remember_bot/src/states.rs index 9492a31e..0bb65bd7 100644 --- a/examples/redis_remember_bot/src/states.rs +++ b/examples/redis_remember_bot/src/states.rs @@ -2,14 +2,19 @@ use teloxide_macros::Transition; use serde::{Deserialize, Serialize}; -#[derive(Transition, SmartDefault, From, Serialize, Deserialize)] +#[derive(Transition, From, Serialize, Deserialize)] pub enum Dialogue { - #[default] Start(StartState), HaveNumber(HaveNumberState), } -#[derive(Default, Serialize, Deserialize)] +impl Default for Dialogue { + fn default() -> Self { + Self::Start(StartState) + } +} + +#[derive(Serialize, Deserialize)] pub struct StartState; #[derive(Serialize, Deserialize)]