diff --git a/src/model/error.rs b/src/model/error.rs index 8ae17e14c42..f97f4dad0b5 100644 --- a/src/model/error.rs +++ b/src/model/error.rs @@ -106,14 +106,14 @@ impl fmt::Display for Minimum { /// [`GuildId::ban`] method, which in this example is used to re-ban all members. /// /// ```rust,no_run -/// # use serenity::http::Http; /// use serenity::model::prelude::*; /// use serenity::model::ModelError; /// use serenity::prelude::*; /// use serenity::Error; /// +/// # #[cfg(feature = "http")] /// # async fn run() -> Result<(), Box> { -/// # let http: Http = unimplemented!(); +/// # let http: serenity::http::Http = unimplemented!(); /// # let guild_id: GuildId = unimplemented!(); /// # let user: User = unimplemented!(); /// diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index 343860b949e..4ae68ef6bf1 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -926,11 +926,10 @@ impl Guild { /// ```rust,no_run /// # use serenity::model::prelude::*; /// # use serenity::prelude::*; - /// # use serenity::cache::Cache; /// /// # #[cfg(feature = "cache")] /// # async fn run() -> Result<(), Box> { - /// # let cache: Cache = unimplemented!(); + /// # let cache: serenity::cache::Cache = unimplemented!(); /// # let msg: Message = unimplemented!(); /// /// if let Some(guild_id) = msg.guild_id { diff --git a/src/model/guild/partial_guild.rs b/src/model/guild/partial_guild.rs index 7af93182229..af805a43f9b 100644 --- a/src/model/guild/partial_guild.rs +++ b/src/model/guild/partial_guild.rs @@ -277,11 +277,10 @@ impl PartialGuild { /// ```rust,no_run /// # use serenity::model::prelude::*; /// # use serenity::prelude::*; - /// # use serenity::cache::Cache; /// /// # #[cfg(feature = "cache")] /// # async fn run() -> Result<(), Box> { - /// # let cache: Cache = unimplemented!(); + /// # let cache: serenity::cache::Cache = unimplemented!(); /// # let msg: Message = unimplemented!(); /// /// if let Some(guild_id) = msg.guild_id { diff --git a/src/secrets.rs b/src/secrets.rs index 33f2a2bfbd8..223631756ac 100644 --- a/src/secrets.rs +++ b/src/secrets.rs @@ -38,13 +38,14 @@ impl zeroize::Zeroize for SecretString { } #[cfg(feature = "typesize")] -impl typesize::TypeSize for Token { +impl typesize::TypeSize for SecretString { fn extra_size(&self) -> usize { self.0.len() + (size_of::() * 2) } } /// A type for securely storing and passing around a Discord token. +#[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Token(SecretString);