diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/model/channel.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/model/channel.rs b/src/model/channel.rs index 4f67e75..8824932 100644 --- a/src/model/channel.rs +++ b/src/model/channel.rs @@ -1539,10 +1539,7 @@ impl Message { /// [`guild_id`]: #method.guild_id #[cfg(feature="cache")] pub fn guild(&self) -> Option<Arc<RwLock<Guild>>> { - match self.guild_id().map(|guild_id| CACHE.read().unwrap().get_guild(guild_id)) { - Some(Some(x)) => Some(x), - _ => None, - } + self.guild_id().and_then(|guild_id| CACHE.read().unwrap().get_guild(guild_id)) } /// Retrieves the Id of the guild that the message was sent in, if sent in |