diff options
| author | Austin Hellyer <[email protected]> | 2016-12-29 12:01:35 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-12-29 12:01:35 -0800 |
| commit | 5c40e85001b9b2620a76fcc57d8f0cddfb6f9b34 (patch) | |
| tree | 5978f6ac14f039cc5d88c981ffe5bbdbc949c8b0 | |
| parent | "Fix" clippy lints (diff) | |
| download | serenity-5c40e85001b9b2620a76fcc57d8f0cddfb6f9b34.tar.xz serenity-5c40e85001b9b2620a76fcc57d8f0cddfb6f9b34.zip | |
Slightly simplify Shard::set_presence
| -rw-r--r-- | src/client/gateway/shard.rs | 9 |
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); |