aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-03-01 09:09:13 -0800
committerZeyla Hellyer <[email protected]>2017-03-01 09:09:13 -0800
commitcafd64ee1947e5518e2b1f120220686481beedf9 (patch)
tree3f203a9fbeb0e9fe8d2076093097b9a1445ebc77 /src
parentAdd Message::guild() (diff)
downloadserenity-cafd64ee1947e5518e2b1f120220686481beedf9.tar.xz
serenity-cafd64ee1947e5518e2b1f120220686481beedf9.zip
a
Diffstat (limited to 'src')
-rw-r--r--src/model/channel.rs5
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