aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-11-10 20:37:26 -0800
committerAustin Hellyer <[email protected]>2016-11-10 20:37:26 -0800
commitd75f712b7ac4a2758a32424250a7505823b69e29 (patch)
treea9b6372bbb9657c6a88a9c61075164f9499b7791 /src
parentFix leave_guild endpoint (diff)
downloadserenity-d75f712b7ac4a2758a32424250a7505823b69e29.tar.xz
serenity-d75f712b7ac4a2758a32424250a7505823b69e29.zip
Add a clippy config
Diffstat (limited to 'src')
-rw-r--r--src/client/http/mod.rs10
-rw-r--r--src/ext/state/mod.rs8
-rw-r--r--src/lib.rs4
3 files changed, 11 insertions, 11 deletions
diff --git a/src/client/http/mod.rs b/src/client/http/mod.rs
index 559cc66..fa7e874 100644
--- a/src/client/http/mod.rs
+++ b/src/client/http/mod.rs
@@ -552,14 +552,14 @@ pub fn edit_webhook_with_token(webhook_id: u64, token: &str, map: Value)
///
/// The map can _optionally_ contain the following data:
///
-/// - **avatar_url**: Override the default avatar of the webhook with a URL.
-/// - **tts**: Whether this is a text-to-speech message (defaults to `false`).
-/// - **username**: Override the default username of the webhook.
+/// - `avatar_url`: Override the default avatar of the webhook with a URL.
+/// - `tts`: Whether this is a text-to-speech message (defaults to `false`).
+/// - `username`: Override the default username of the webhook.
///
/// Additionally, _at least one_ of the following must be given:
///
-/// - **content**: The content of the message.
-/// - **embeds**: An array of rich embeds.
+/// - `content`: The content of the message.
+/// - `embeds`: An array of rich embeds.
///
/// **Note**: For embed objects, all fields are registered by Discord except for
/// `height`, `provider`, `proxy_url`, `type` (it will always be `rich`),
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);
}
}
diff --git a/src/lib.rs b/src/lib.rs
index c10836b..9853f18 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -74,8 +74,8 @@
//! [docs]: https://discordapp.com/developers/docs/intro
//! [examples]: https://github.com/zeyla/serenity.rs/tree/master/examples
//! [state docs]: ext/state/index.html
-#![allow(doc_markdown, inline_always, unknown_lints)]
-#![warn(dead_code)]
+#![allow(inline_always, unknown_lints)]
+#![warn(dead_code, enum_glob_use, if_not_else)]
#[macro_use]
extern crate bitflags;