From 3e01e0f65fb0fcab5573979981db035f2174a980 Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Fri, 31 Jul 2020 16:16:14 +0600 Subject: [PATCH] Remove Arc from dialogues_repl --- src/dispatching/repls/dialogues_repl.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/dispatching/repls/dialogues_repl.rs b/src/dispatching/repls/dialogues_repl.rs index 16d54a55..672afe13 100644 --- a/src/dispatching/repls/dialogues_repl.rs +++ b/src/dispatching/repls/dialogues_repl.rs @@ -1,17 +1,15 @@ use crate::{ dispatching::{ - dialogue::{DialogueDispatcher, DialogueStage, DialogueWithCx, GetChatId}, + dialogue::{DialogueDispatcher, DialogueStage, DialogueWithCx}, update_listeners, update_listeners::UpdateListener, - Dispatcher, DispatcherHandlerRx, DispatcherHandlerRxExt, UpdateWithCx, + Dispatcher, UpdateWithCx, }, error_handlers::{LoggingErrorHandler, OnError}, types::Message, - utils::command::BotCommand, Bot, }; -use futures::StreamExt; -use std::{convert::Infallible, fmt::Debug, future::Future, sync::Arc}; +use std::{convert::Infallible, fmt::Debug, future::Future}; /// A [REPL] for dialogues. /// @@ -74,8 +72,6 @@ pub async fn dialogues_repl_with_listener<'a, H, D, Fut, L, ListenerE, HandlerE> Result, HandlerE>: OnError, HandlerE: Debug + Send, { - let handler = Arc::new(handler); - Dispatcher::new(bot) .messages_handler(DialogueDispatcher::new( |DialogueWithCx { cx, dialogue }: DialogueWithCx| async move {