diff options
| author | Austin Hellyer <[email protected]> | 2016-11-10 20:37:26 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-10 20:37:26 -0800 |
| commit | d75f712b7ac4a2758a32424250a7505823b69e29 (patch) | |
| tree | a9b6372bbb9657c6a88a9c61075164f9499b7791 /src/ext | |
| parent | Fix leave_guild endpoint (diff) | |
| download | serenity-d75f712b7ac4a2758a32424250a7505823b69e29.tar.xz serenity-d75f712b7ac4a2758a32424250a7505823b69e29.zip | |
Add a clippy config
Diffstat (limited to 'src/ext')
| -rw-r--r-- | src/ext/state/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ext/state/mod.rs b/src/ext/state/mod.rs index d4c250d..04e77d9 100644 --- a/src/ext/state/mod.rs +++ b/src/ext/state/mod.rs @@ -615,10 +615,7 @@ impl State { event: &VoiceStateUpdateEvent) { if let Some(guild_id) = event.guild_id { if let Some(guild) = self.guilds.get_mut(&guild_id) { - if !event.voice_state.channel_id.is_some() { - // Remove the user from the voice state list - guild.voice_states.remove(&event.voice_state.user_id); - } else { + if event.voice_state.channel_id.is_some() { // Update or add to the voice state list { let finding = guild.voice_states @@ -633,6 +630,9 @@ impl State { guild.voice_states.insert(event.voice_state.user_id, event.voice_state.clone()); + } else { + // Remove the user from the voice state list + guild.voice_states.remove(&event.voice_state.user_id); } } |