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 3d1356517b3..beacc3e4310 100644 --- a/src/http/client.rs +++ b/src/http/client.rs @@ -4025,7 +4025,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 5865a2573da..a162c7b3570 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 8bdf71b23d1..f0544d0c89b 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 f359b37ce0b..82e1023fe72 100644 --- a/src/model/channel/message.rs +++ b/src/model/channel/message.rs @@ -439,7 +439,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 d3c61081939..b67b27695db 100644 --- a/src/model/channel/private_channel.rs +++ b/src/model/channel/private_channel.rs @@ -224,7 +224,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 99d8a65ea3e..9b28a721458 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::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 d674ad89d35..48b587403bc 100644 --- a/src/model/guild/guild_id.rs +++ b/src/model/guild/guild_id.rs @@ -1100,9 +1100,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 6490862a2bc..9368a352478 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -1598,7 +1598,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 c8290d75233..517ccae2b4c 100644 --- a/src/model/guild/partial_guild.rs +++ b/src/model/guild/partial_guild.rs @@ -1308,7 +1308,7 @@ impl PartialGuild { &self, http: impl AsRef, limit: Option, - after: impl Into>, + after: Option, ) -> Result> { self.id.members(http, limit, after).await }