From 63b3be8db7a60a288220bce00e304369279f4158 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Mon, 18 Apr 2022 14:13:39 +0400 Subject: [PATCH] Update dptree, now to a crates.io version! --- Cargo.toml | 3 +-- src/dispatching/handler_description.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9900f0ad..9ba73e08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,8 +62,7 @@ teloxide-macros = { git = "https://github.com/teloxide/teloxide-macros.git", rev serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -#dptree = { version = "0.1.0" } -dptree = { git = "https://github.com/WaffleLapkin/dptree", rev = "be04745" } +dptree = { version = "0.2.0" } tokio = { version = "1.8", features = ["fs"] } tokio-util = "0.6" diff --git a/src/dispatching/handler_description.rs b/src/dispatching/handler_description.rs index 9c7c2a0a..cf3b4e4f 100644 --- a/src/dispatching/handler_description.rs +++ b/src/dispatching/handler_description.rs @@ -1,29 +1,29 @@ use std::collections::HashSet; -use dptree::{EventKindDescription, HandlerDescription}; +use dptree::{description::EventKind, HandlerDescription}; use teloxide_core::types::AllowedUpdate; /// Handler description that is used by [`Dispatcher`]. /// /// [`Dispatcher`]: crate::dispatching::Dispatcher pub struct DpHandlerDescription { - allowed: EventKindDescription, + allowed: EventKind, } impl DpHandlerDescription { pub(crate) fn of(allowed: AllowedUpdate) -> Self { let mut set = HashSet::with_capacity(1); set.insert(allowed); - Self { allowed: EventKindDescription::InterestList(set) } + Self { allowed: EventKind::InterestList(set) } } pub(crate) fn allowed_updates(&self) -> Vec { use AllowedUpdate::*; match &self.allowed { - EventKindDescription::InterestList(set) => set.iter().copied().collect(), - EventKindDescription::Entry => panic!("No updates were allowed"), - EventKindDescription::UserDefined => vec![ + EventKind::InterestList(set) => set.iter().copied().collect(), + EventKind::Entry => panic!("No updates were allowed"), + EventKind::UserDefined => vec![ Message, EditedMessage, ChannelPost,