diff options
| author | acdenisSK <[email protected]> | 2017-11-04 23:12:17 +0100 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-11-04 23:12:17 +0100 |
| commit | 2032a402c387b1310f2ae62621f3e07c86b76aef (patch) | |
| tree | e34c35de1eb517d9b2469f02cd179ab9e6b34544 /src/model/guild/mod.rs | |
| parent | Merge v0.4.3 (diff) | |
| download | serenity-2032a402c387b1310f2ae62621f3e07c86b76aef.tar.xz serenity-2032a402c387b1310f2ae62621f3e07c86b76aef.zip | |
Whoops. Add a `FromStr` impl for `ReactionType`
Diffstat (limited to 'src/model/guild/mod.rs')
| -rw-r--r-- | src/model/guild/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index ab74109..1e0ef7c 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -136,7 +136,7 @@ impl Guild { pub fn default_channel(&self, uid: UserId) -> Option<Arc<RwLock<GuildChannel>>> { for (cid, channel) in &self.channels { if self.permissions_in(*cid, uid).read_messages() { - return Some(channel.read().unwrap().clone()); + return Some(Arc::clone(&channel)); } } @@ -152,7 +152,7 @@ impl Guild { for (cid, channel) in &self.channels { for memid in self.members.keys() { if self.permissions_in(*cid, *memid).read_messages() { - return Some(channel.read().unwrap().clone()); + return Some(Arc::clone(&channel)); } } } @@ -162,7 +162,7 @@ impl Guild { #[cfg(feature = "cache")] fn has_perms(&self, mut permissions: Permissions) -> bool { - let user_id = CACHE.read().unwrap().user.id; + let user_id = CACHE.read().user.id; let perms = self.member_permissions(user_id); permissions.remove(perms); @@ -1040,7 +1040,7 @@ impl Guild { } else { warn!( "(╯°□°)╯︵ ┻━┻ {} on {} has non-existent role {:?}", - member.user.read().unwrap().id, + member.user.read().id, self.id, role, ); |