aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-12-29 12:01:35 -0800
committerAustin Hellyer <[email protected]>2016-12-29 12:01:35 -0800
commit5c40e85001b9b2620a76fcc57d8f0cddfb6f9b34 (patch)
tree5978f6ac14f039cc5d88c981ffe5bbdbc949c8b0
parent"Fix" clippy lints (diff)
downloadserenity-5c40e85001b9b2620a76fcc57d8f0cddfb6f9b34.tar.xz
serenity-5c40e85001b9b2620a76fcc57d8f0cddfb6f9b34.zip
Slightly simplify Shard::set_presence
-rw-r--r--src/client/gateway/shard.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/client/gateway/shard.rs b/src/client/gateway/shard.rs
index 8a6222a..03774ac 100644
--- a/src/client/gateway/shard.rs
+++ b/src/client/gateway/shard.rs
@@ -239,12 +239,11 @@ impl Shard {
/// ```
pub fn set_presence(&mut self,
game: Option<Game>,
- status: OnlineStatus,
+ mut status: OnlineStatus,
afk: bool) {
- let status = match status {
- OnlineStatus::Offline => OnlineStatus::Invisible,
- other => other,
- };
+ if status == OnlineStatus::Offline {
+ status = OnlineStatus::Invisible;
+ }
self.current_presence = (game, status, afk);