diff --git a/src/builder/edit_channel.rs b/src/builder/edit_channel.rs index 1323b6d01c4..2aeb11fe63b 100644 --- a/src/builder/edit_channel.rs +++ b/src/builder/edit_channel.rs @@ -170,8 +170,8 @@ impl<'a> EditChannel<'a> { /// [text]: ChannelType::Text /// [voice]: ChannelType::Voice #[inline] - pub fn category>>(mut self, category: C) -> Self { - self.parent_id = Some(category.into()); + pub fn category(mut self, category: Option) -> Self { + self.parent_id = Some(category); self } diff --git a/src/http/client.rs b/src/http/client.rs index 9db1924f57e..379fe7d542f 100644 --- a/src/http/client.rs +++ b/src/http/client.rs @@ -4027,7 +4027,7 @@ impl Http { message_id: MessageId, reaction_type: &ReactionType, limit: u8, - after: Option, + after: Option, ) -> Result> { let mut params = ArrayVec::<_, 2>::new(); params.push(("limit", limit.to_string())); diff --git a/src/model/channel/channel_id.rs b/src/model/channel/channel_id.rs index a8555c60752..2ef384a66a0 100644 --- a/src/model/channel/channel_id.rs +++ b/src/model/channel/channel_id.rs @@ -619,18 +619,12 @@ impl ChannelId { message_id: impl Into, reaction_type: impl Into, limit: Option, - after: impl Into>, + after: Option, ) -> Result> { let limit = limit.map_or(50, |x| if x > 100 { 100 } else { x }); http.as_ref() - .get_reaction_users( - self, - message_id.into(), - &reaction_type.into(), - limit, - after.into().map(UserId::get), - ) + .get_reaction_users(self, message_id.into(), &reaction_type.into(), limit, after) .await } diff --git a/src/model/channel/guild_channel.rs b/src/model/channel/guild_channel.rs index 7559a7a3853..dd72ce03f9b 100644 --- a/src/model/channel/guild_channel.rs +++ b/src/model/channel/guild_channel.rs @@ -826,7 +826,7 @@ impl GuildChannel { message_id: impl Into, reaction_type: impl Into, limit: Option, - after: impl Into>, + after: Option, ) -> Result> { self.id.reaction_users(http, message_id, reaction_type, limit, after).await } diff --git a/src/model/channel/message.rs b/src/model/channel/message.rs index 0fcc2f381b0..37065b2e098 100644 --- a/src/model/channel/message.rs +++ b/src/model/channel/message.rs @@ -440,7 +440,7 @@ impl Message { http: impl AsRef, reaction_type: impl Into, limit: Option, - after: impl Into>, + after: Option, ) -> Result> { self.channel_id.reaction_users(http, self.id, reaction_type, limit, after).await } diff --git a/src/model/channel/private_channel.rs b/src/model/channel/private_channel.rs index db0bb9a1024..061d6d237b4 100644 --- a/src/model/channel/private_channel.rs +++ b/src/model/channel/private_channel.rs @@ -227,7 +227,7 @@ impl PrivateChannel { message_id: impl Into, reaction_type: impl Into, limit: Option, - after: impl Into>, + after: Option, ) -> Result> { self.id.reaction_users(http, message_id, reaction_type, limit, after).await } diff --git a/src/model/channel/reaction.rs b/src/model/channel/reaction.rs index afffe397f33..d71be17eddd 100644 --- a/src/model/channel/reaction.rs +++ b/src/model/channel/reaction.rs @@ -4,6 +4,7 @@ use std::fmt::Display as _; use std::fmt::{self, Write as _}; use std::str::FromStr; +use nonmax::NonMaxU8; #[cfg(feature = "http")] use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC}; use serde::de::{Deserialize, Error as DeError}; @@ -216,7 +217,7 @@ impl Reaction { &self, http: impl AsRef, reaction_type: R, - limit: Option, + limit: Option, after: Option, ) -> Result> where @@ -230,10 +231,10 @@ impl Reaction { &self, http: impl AsRef, reaction_type: &ReactionType, - limit: Option, + limit: Option, after: Option, ) -> Result> { - let mut limit = limit.unwrap_or(50); + let mut limit = limit.map_or(50, |limit| limit.get()); if limit > 100 { limit = 100; @@ -241,13 +242,7 @@ impl Reaction { } http.as_ref() - .get_reaction_users( - self.channel_id, - self.message_id, - reaction_type, - limit, - after.map(UserId::get), - ) + .get_reaction_users(self.channel_id, self.message_id, reaction_type, limit, after) .await } } diff --git a/src/model/guild/guild_id.rs b/src/model/guild/guild_id.rs index 889caa0ec97..594e44cec97 100644 --- a/src/model/guild/guild_id.rs +++ b/src/model/guild/guild_id.rs @@ -1102,9 +1102,9 @@ impl GuildId { self, http: impl AsRef, limit: Option, - after: impl Into>, + after: Option, ) -> Result> { - http.as_ref().get_guild_members(self, limit, after.into().map(UserId::get)).await + http.as_ref().get_guild_members(self, limit, after.map(UserId::get)).await } /// Streams over all the members in a guild. diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index 68bb7cc8c16..09a939d2a9a 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -1609,7 +1609,7 @@ impl Guild { &self, http: impl AsRef, limit: Option, - after: impl Into>, + after: Option, ) -> Result> { self.id.members(http, limit, after).await } diff --git a/src/model/guild/partial_guild.rs b/src/model/guild/partial_guild.rs index f4a158ce439..fcd0e79229b 100644 --- a/src/model/guild/partial_guild.rs +++ b/src/model/guild/partial_guild.rs @@ -1326,7 +1326,7 @@ impl PartialGuild { &self, http: impl AsRef, limit: Option, - after: impl Into>, + after: Option, ) -> Result> { self.id.members(http, limit, after).await }