diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f75d371..e191b869 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated `axum` to v0.6.0. - The module structure - `teloxide::dispatching::update_listeners` => `teloxide::update_listeners` - - `teloxide::dispatching::dialogue::storage` => `teloxide::storage` - `teloxide::dispatching::repls` => `teloxide::repls` ### Removed diff --git a/crates/teloxide/src/dispatching/dialogue.rs b/crates/teloxide/src/dispatching/dialogue.rs index 0fc3439d..a577b999 100644 --- a/crates/teloxide/src/dispatching/dialogue.rs +++ b/crates/teloxide/src/dispatching/dialogue.rs @@ -93,23 +93,24 @@ //! //! [`examples/dialogue.rs`]: https://github.com/teloxide/teloxide/blob/master/examples/dialogue.rs -/// This module was moved to [`teloxide::storage`]. -/// -/// [`teloxide::storage`]: crate::storage -#[deprecated] -pub mod storage { - pub use crate::storage::*; -} +#[cfg(feature = "redis-storage")] +pub use self::{RedisStorage, RedisStorageError}; + +#[cfg(feature = "sqlite-storage")] +pub use self::{SqliteStorage, SqliteStorageError}; -pub use crate::storage::*; pub use get_chat_id::GetChatId; +pub use storage::*; -use crate::{dispatching::DpHandlerDescription, types::ChatId}; use dptree::{prelude::DependencyMap, Handler}; +use teloxide_core::types::ChatId; use std::{fmt::Debug, marker::PhantomData, sync::Arc}; +use super::DpHandlerDescription; + mod get_chat_id; +mod storage; /// A handle for controlling dialogue state. #[derive(Debug)] diff --git a/crates/teloxide/src/storage.rs b/crates/teloxide/src/dispatching/dialogue/storage.rs similarity index 100% rename from crates/teloxide/src/storage.rs rename to crates/teloxide/src/dispatching/dialogue/storage.rs diff --git a/crates/teloxide/src/storage/in_mem_storage.rs b/crates/teloxide/src/dispatching/dialogue/storage/in_mem_storage.rs similarity index 100% rename from crates/teloxide/src/storage/in_mem_storage.rs rename to crates/teloxide/src/dispatching/dialogue/storage/in_mem_storage.rs diff --git a/crates/teloxide/src/storage/redis_storage.rs b/crates/teloxide/src/dispatching/dialogue/storage/redis_storage.rs similarity index 100% rename from crates/teloxide/src/storage/redis_storage.rs rename to crates/teloxide/src/dispatching/dialogue/storage/redis_storage.rs diff --git a/crates/teloxide/src/storage/serializer.rs b/crates/teloxide/src/dispatching/dialogue/storage/serializer.rs similarity index 100% rename from crates/teloxide/src/storage/serializer.rs rename to crates/teloxide/src/dispatching/dialogue/storage/serializer.rs diff --git a/crates/teloxide/src/storage/sqlite_storage.rs b/crates/teloxide/src/dispatching/dialogue/storage/sqlite_storage.rs similarity index 100% rename from crates/teloxide/src/storage/sqlite_storage.rs rename to crates/teloxide/src/dispatching/dialogue/storage/sqlite_storage.rs diff --git a/crates/teloxide/src/storage/trace_storage.rs b/crates/teloxide/src/dispatching/dialogue/storage/trace_storage.rs similarity index 100% rename from crates/teloxide/src/storage/trace_storage.rs rename to crates/teloxide/src/dispatching/dialogue/storage/trace_storage.rs diff --git a/crates/teloxide/src/dispatching/handler_ext.rs b/crates/teloxide/src/dispatching/handler_ext.rs index 0495f0b9..0013acb4 100644 --- a/crates/teloxide/src/dispatching/handler_ext.rs +++ b/crates/teloxide/src/dispatching/handler_ext.rs @@ -1,6 +1,8 @@ use crate::{ - dispatching::{dialogue::GetChatId, DpHandlerDescription}, - storage::Storage, + dispatching::{ + dialogue::{GetChatId, Storage}, + DpHandlerDescription, + }, types::{Me, Message}, utils::command::BotCommands, }; diff --git a/crates/teloxide/src/lib.rs b/crates/teloxide/src/lib.rs index 15c88d49..1e86d521 100644 --- a/crates/teloxide/src/lib.rs +++ b/crates/teloxide/src/lib.rs @@ -72,7 +72,6 @@ pub mod prelude; #[cfg(all(feature = "ctrlc_handler"))] pub mod repls; pub mod stop; -pub mod storage; pub mod update_listeners; pub mod utils;