From a18004ca46cd5c5a1c365b94da61524fec944f3d Mon Sep 17 00:00:00 2001 From: Gnome! Date: Wed, 13 Mar 2024 10:17:43 +0000 Subject: [PATCH] Remove useless method wrappers (#2795) --- src/cache/mod.rs | 12 ------------ src/model/guild/mod.rs | 10 ---------- 2 files changed, 22 deletions(-) diff --git a/src/cache/mod.rs b/src/cache/mod.rs index 52ab10de315..3ffd179fcd1 100644 --- a/src/cache/mod.rs +++ b/src/cache/mod.rs @@ -454,19 +454,11 @@ impl Cache { /// [`EventHandler::message`]: crate::client::EventHandler::message /// [`members`]: crate::model::guild::Guild::members pub fn member(&self, guild_id: GuildId, user_id: UserId) -> Option> { - self._member(guild_id, user_id) - } - - fn _member(&self, guild_id: GuildId, user_id: UserId) -> Option> { let member = self.guilds.get(&guild_id)?.try_map(|g| g.members.get(&user_id)).ok()?; Some(CacheRef::from_mapped_ref(member)) } pub fn guild_roles(&self, guild_id: GuildId) -> Option> { - self._guild_roles(guild_id) - } - - fn _guild_roles(&self, guild_id: GuildId) -> Option> { let roles = self.guilds.get(&guild_id)?.map(|g| &g.roles); Some(CacheRef::from_mapped_ref(roles)) } @@ -478,10 +470,6 @@ impl Cache { /// This method returns all channels from a guild of with the given `guild_id`. pub fn guild_channels(&self, guild_id: GuildId) -> Option> { - self._guild_channels(guild_id) - } - - fn _guild_channels(&self, guild_id: GuildId) -> Option> { let channels = self.guilds.get(&guild_id)?.map(|g| &g.channels); Some(CacheRef::from_mapped_ref(channels)) } diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index 4481e6e544a..c0a0700855d 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -1269,16 +1269,6 @@ impl Guild { cache: &Cache, lhs_id: UserId, rhs_id: UserId, - ) -> Option { - self._greater_member_hierarchy(cache, lhs_id, rhs_id) - } - - #[cfg(feature = "cache")] - fn _greater_member_hierarchy( - &self, - cache: &Cache, - lhs_id: UserId, - rhs_id: UserId, ) -> Option { // Check that the IDs are the same. If they are, neither is greater. if lhs_id == rhs_id {