From 89b8247cbfd42ca3ae39db339de5af9fe9813aa1 Mon Sep 17 00:00:00 2001 From: LasterAlex Date: Sun, 20 Oct 2024 12:28:49 +0300 Subject: [PATCH] Fixed changelog + more clear imports --- CHANGELOG.md | 3 ++- crates/teloxide/src/dispatching/dispatcher.rs | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 054ce32e..58900259 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `bot.forward`, `bot.edit_live_location`, `bot.stop_live_location`, `bot.set_reaction`, `bot.pin`, `bot.unpin`, `bot.edit_text`, `bot.edit_caption`, `bot.edit_media`, `bot.edit_reply_markup`, `bot.stop_poll_message`, `bot.delete` and `bot.copy` methods to the new `crate::sugar::bot::BotMessagesExt` trait - `req.reply_to` method to the new `crate::sugar::request::RequestReplyExt` trait - `req.disable_link_preview` method to the new `crate::sugar::request::RequestLinkPreviewExt` trait -- `stack_size` setter to `DispatcherBuilder` +- `stack_size` setter to `DispatcherBuilder` ([PR 1185](https://github.com/teloxide/teloxide/pull/1185)) ### Changed @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - MSRV (Minimal Supported Rust Version) was bumped from `1.70.0` to `1.80.0` - Some dependencies was bumped: `sqlx` to `0.8.1`, `tower` to `0.5.0`, `reqwest` to `0.12.7` - `tokio` version was explicitly specified as `1.39` +- Added new `Send` and `Sync` trait bounds to `try_dispatch_with_listener` and `dispatch_with_listener` generic parameters ([PR 1185](https://github.com/teloxide/teloxide/pull/1185)) [**BC**] ### Fixed diff --git a/crates/teloxide/src/dispatching/dispatcher.rs b/crates/teloxide/src/dispatching/dispatcher.rs index 4bc8297e..728d23dd 100644 --- a/crates/teloxide/src/dispatching/dispatcher.rs +++ b/crates/teloxide/src/dispatching/dispatcher.rs @@ -17,7 +17,6 @@ use futures::{ stream::FuturesUnordered, FutureExt as _, StreamExt as _, }; -use tokio::runtime::Builder; use tokio_stream::wrappers::ReceiverStream; use std::{ @@ -31,7 +30,6 @@ use std::{ atomic::{AtomicBool, AtomicU32, Ordering}, Arc, }, - thread, }; /// The builder for [`Dispatcher`]. @@ -412,9 +410,9 @@ where let stop_token = Some(update_listener.stop_token()); - thread::scope(|scope| { + std::thread::scope(|scope| { scope.spawn(move || { - let runtime = Builder::new_multi_thread() + let runtime = tokio::runtime::Builder::new_multi_thread() .thread_stack_size(self.stack_size) .enable_all() .build()