diff options
| author | Austin Hellyer <[email protected]> | 2016-11-10 17:09:24 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-10 17:09:24 -0800 |
| commit | b0e1a70418a629eb1cc71339c9ca6dc2ae0ec2a1 (patch) | |
| tree | dbea47d3cfcf983ba95411fd2e8af35f141cd807 /src/model | |
| parent | Implementing missing HTTP methods (diff) | |
| download | serenity-b0e1a70418a629eb1cc71339c9ca6dc2ae0ec2a1.tar.xz serenity-b0e1a70418a629eb1cc71339c9ca6dc2ae0ec2a1.zip | |
Fix some clippy lints
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/channel.rs | 2 | ||||
| -rw-r--r-- | src/model/utils.rs | 12 | ||||
| -rw-r--r-- | src/model/webhook.rs | 2 |
3 files changed, 2 insertions, 14 deletions
diff --git a/src/model/channel.rs b/src/model/channel.rs index facb67a..178db25 100644 --- a/src/model/channel.rs +++ b/src/model/channel.rs @@ -966,7 +966,7 @@ impl fmt::Display for ReactionType { try!(fmt::Display::fmt(&id, f)); f.write_char('>') }, - ReactionType::Unicode(ref unicode) => f.write_str(&unicode), + ReactionType::Unicode(ref unicode) => f.write_str(unicode), } } } diff --git a/src/model/utils.rs b/src/model/utils.rs index a05ff20..d66b258 100644 --- a/src/model/utils.rs +++ b/src/model/utils.rs @@ -7,7 +7,6 @@ use super::{ EmojiId, Member, Presence, - PublicChannel, ReadState, Relationship, Role, @@ -146,17 +145,6 @@ pub fn decode_private_channels(value: Value) Ok(private_channels) } -pub fn decode_public_channels(value: Value) - -> Result<HashMap<ChannelId, PublicChannel>> { - let mut public_channels = HashMap::new(); - - for public_channel in try!(decode_array(value, PublicChannel::decode)) { - public_channels.insert(public_channel.id, public_channel); - } - - Ok(public_channels) -} - pub fn decode_read_states(value: Value) -> Result<HashMap<ChannelId, ReadState>> { let mut read_states = HashMap::new(); diff --git a/src/model/webhook.rs b/src/model/webhook.rs index 70acd68..aaab2ab 100644 --- a/src/model/webhook.rs +++ b/src/model/webhook.rs @@ -71,7 +71,7 @@ impl Webhook { let mut map = ObjectBuilder::new(); if let Some(avatar) = avatar { - map = map.insert("avatar", if avatar.len() == 0 { + map = map.insert("avatar", if avatar.is_empty() { Value::Null } else { Value::String(avatar.to_owned()) |