From ccd87a6ed36f47033445e61800a452da5dab62d1 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Thu, 10 Feb 2022 16:39:21 +0300 Subject: [PATCH] Remove `doc(cfg)` annotations in favour of `feature(doc_auto_cfg)` --- src/dispatching/dialogue/mod.rs | 2 -- src/dispatching/dialogue/storage/mod.rs | 1 - src/dispatching/dialogue/storage/serializer.rs | 4 ---- src/dispatching/dispatcher.rs | 1 - src/dispatching2/dialogue/mod.rs | 1 - src/dispatching2/dispatcher.rs | 1 - src/lib.rs | 7 +------ src/prelude.rs | 2 -- src/prelude2.rs | 1 - src/utils/command.rs | 1 - src/utils/mod.rs | 1 - 11 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/dispatching/dialogue/mod.rs b/src/dispatching/dialogue/mod.rs index 962c27f6..3f336d73 100644 --- a/src/dispatching/dialogue/mod.rs +++ b/src/dispatching/dialogue/mod.rs @@ -161,11 +161,9 @@ pub use transition::{ }; #[cfg(feature = "macros")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "macros")))] pub use teloxide_macros::Transition; #[cfg(feature = "redis-storage")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "redis-storage")))] pub use storage::{RedisStorage, RedisStorageError}; #[cfg(feature = "sqlite-storage")] diff --git a/src/dispatching/dialogue/storage/mod.rs b/src/dispatching/dialogue/storage/mod.rs index dbf4c25a..506e18bf 100644 --- a/src/dispatching/dialogue/storage/mod.rs +++ b/src/dispatching/dialogue/storage/mod.rs @@ -17,7 +17,6 @@ pub use self::{ }; #[cfg(feature = "redis-storage")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "redis-storage")))] pub use redis_storage::{RedisStorage, RedisStorageError}; pub use serializer::Serializer; use std::sync::Arc; diff --git a/src/dispatching/dialogue/storage/serializer.rs b/src/dispatching/dialogue/storage/serializer.rs index 2fb30cbc..12bd74d1 100644 --- a/src/dispatching/dialogue/storage/serializer.rs +++ b/src/dispatching/dialogue/storage/serializer.rs @@ -32,11 +32,9 @@ where /// /// [CBOR]: https://en.wikipedia.org/wiki/CBOR #[cfg(feature = "cbor-serializer")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "cbor-serializer")))] pub struct Cbor; #[cfg(feature = "cbor-serializer")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "cbor-serializer")))] impl Serializer for Cbor where D: Serialize + DeserializeOwned, @@ -56,11 +54,9 @@ where /// /// [Bincode]: https://github.com/servo/bincode #[cfg(feature = "bincode-serializer")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "bincode-serializer")))] pub struct Bincode; #[cfg(feature = "bincode-serializer")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "bincode-serializer")))] impl Serializer for Bincode where D: Serialize + DeserializeOwned, diff --git a/src/dispatching/dispatcher.rs b/src/dispatching/dispatcher.rs index ec486abb..09852ec0 100644 --- a/src/dispatching/dispatcher.rs +++ b/src/dispatching/dispatcher.rs @@ -100,7 +100,6 @@ where /// /// [`shutdown`]: ShutdownToken::shutdown #[cfg(feature = "ctrlc_handler")] - #[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "ctrlc_handler")))] #[must_use] pub fn setup_ctrlc_handler(self) -> Self { let token = self.state.clone(); diff --git a/src/dispatching2/dialogue/mod.rs b/src/dispatching2/dialogue/mod.rs index 5222b1a7..cf9867ed 100644 --- a/src/dispatching2/dialogue/mod.rs +++ b/src/dispatching2/dialogue/mod.rs @@ -86,7 +86,6 @@ //! [`examples/dialogue.rs`]: https://github.com/teloxide/teloxide/blob/master/examples/dialogue.rs #[cfg(feature = "redis-storage")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "redis-storage")))] pub use crate::dispatching::dialogue::{RedisStorage, RedisStorageError}; #[cfg(feature = "sqlite-storage")] diff --git a/src/dispatching2/dispatcher.rs b/src/dispatching2/dispatcher.rs index 369fd1a2..9f1add78 100644 --- a/src/dispatching2/dispatcher.rs +++ b/src/dispatching2/dispatcher.rs @@ -243,7 +243,6 @@ where /// /// [`shutdown`]: ShutdownToken::shutdown #[cfg(feature = "ctrlc_handler")] - #[cfg_attr(docsrs, doc(cfg(feature = "ctrlc_handler")))] pub fn setup_ctrlc_handler(&mut self) -> &mut Self { let token = self.state.clone(); tokio::spawn(async move { diff --git a/src/lib.rs b/src/lib.rs index 0902226c..cd51abc2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -53,7 +53,7 @@ // ```console // $ RUSTFLAGS="--cfg dep_docsrs" RUSTDOCFLAGS="--cfg docsrs -Znormalize-docs" cargo +nightly doc --open --all-features // ``` -#![cfg_attr(all(docsrs, feature = "nightly"), feature(doc_cfg))] +#![cfg_attr(all(docsrs, feature = "nightly"), feature(doc_cfg, doc_auto_cfg))] #![forbid(unsafe_code)] #![warn(rustdoc::broken_intra_doc_links)] #![allow(clippy::match_bool)] @@ -74,12 +74,10 @@ mod logging; // Things from this module is also used for the dispatching2 module. pub mod dispatching; #[cfg(feature = "dispatching2")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "dispatching2")))] pub mod dispatching2; pub mod error_handlers; pub mod prelude; #[cfg(feature = "dispatching2")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "dispatching2")))] pub mod prelude2; pub mod utils; @@ -87,13 +85,10 @@ pub mod utils; pub use teloxide_core::*; #[cfg(feature = "macros")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "macros")))] pub use teloxide_macros as macros; #[cfg(feature = "dispatching2")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "dispatching2")))] pub use dptree; -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "macros")))] #[cfg(feature = "macros")] pub use teloxide_macros::teloxide; diff --git a/src/prelude.rs b/src/prelude.rs index 9fa5ffb6..b8a9d05b 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -16,7 +16,6 @@ pub use crate::dispatching::{ Dispatcher, DispatcherHandlerRx, DispatcherHandlerRxExt, UpdateWithCx, }; -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "macros")))] #[cfg(feature = "macros")] pub use crate::teloxide; @@ -32,7 +31,6 @@ pub use crate::adaptors::AutoSend; pub use teloxide_core::prelude::*; #[cfg(feature = "frunk")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "frunk")))] pub use crate::utils::UpState; pub use tokio::sync::mpsc::UnboundedReceiver; diff --git a/src/prelude2.rs b/src/prelude2.rs index 79aadf51..5f703d3b 100644 --- a/src/prelude2.rs +++ b/src/prelude2.rs @@ -9,7 +9,6 @@ pub use crate::dispatching2::{ dialogue::Dialogue, Dispatcher, HandlerExt as _, MessageFilterExt as _, UpdateFilterExt as _, }; -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "macros")))] #[cfg(feature = "macros")] pub use crate::teloxide; diff --git a/src/utils/command.rs b/src/utils/command.rs index 35023099..41e394f1 100644 --- a/src/utils/command.rs +++ b/src/utils/command.rs @@ -53,7 +53,6 @@ use std::{ use std::marker::PhantomData; #[cfg(feature = "macros")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "macros")))] pub use teloxide_macros::BotCommand; /// An enumeration of bot's commands. diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 928fe6fe..f4aafd4d 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -9,5 +9,4 @@ mod up_state; pub use teloxide_core::net::client_from_env; #[cfg(feature = "frunk")] -#[cfg_attr(all(docsrs, feature = "nightly"), doc(cfg(feature = "frunk")))] pub use up_state::UpState;