diff options
| author | Austin Hellyer <[email protected]> | 2016-12-08 17:37:44 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-12-09 16:09:46 -0800 |
| commit | c7ffc4d4dd1ad63fae7a58f2299497aa3e3a39e7 (patch) | |
| tree | 438143459a40d423f445647facc336895b2e4d79 /src/model | |
| parent | Command builder, quoted args, and multi-prefixes (diff) | |
| download | serenity-c7ffc4d4dd1ad63fae7a58f2299497aa3e3a39e7.tar.xz serenity-c7ffc4d4dd1ad63fae7a58f2299497aa3e3a39e7.zip | |
Fix some clippy lints
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/channel.rs | 4 | ||||
| -rw-r--r-- | src/model/id.rs | 2 | ||||
| -rw-r--r-- | src/model/misc.rs | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/model/channel.rs b/src/model/channel.rs index 19f59ef..4ba31d6 100644 --- a/src/model/channel.rs +++ b/src/model/channel.rs @@ -656,7 +656,7 @@ impl Message { } }} - let mut gen = format!("{}", self.author.mention()); + let mut gen = self.author.mention(); gen.push_str(": "); gen.push_str(content); @@ -1197,7 +1197,7 @@ impl fmt::Display for ReactionType { ReactionType::Custom { id, ref name } => { f.write_char('<')?; f.write_char(':')?; - f.write_str(&name)?; + f.write_str(name)?; f.write_char(':')?; fmt::Display::fmt(&id, f)?; f.write_char('>') diff --git a/src/model/id.rs b/src/model/id.rs index cbbd796..d0d0b61 100644 --- a/src/model/id.rs +++ b/src/model/id.rs @@ -176,7 +176,7 @@ impl UserId { /// Search the cache for the channel with the Id. #[cfg(all(feature = "cache", feature = "methods"))] pub fn find(&self) -> Option<User> { - CACHE.read().unwrap().get_user(*self).map(|x| x.clone()) + CACHE.read().unwrap().get_user(*self).cloned() } } diff --git a/src/model/misc.rs b/src/model/misc.rs index e078bac..263362f 100644 --- a/src/model/misc.rs +++ b/src/model/misc.rs @@ -97,7 +97,7 @@ impl FromStr for User { impl FromStr for UserId { type Err = (); fn from_str(s: &str) -> StdResult<Self, ()> { - utils::parse_username(s).ok_or_else(|| ()).map(|x| UserId(x)) + utils::parse_username(s).ok_or_else(|| ()).map(UserId) } } @@ -120,7 +120,7 @@ impl FromStr for Role { impl FromStr for RoleId { type Err = (); fn from_str(s: &str) -> StdResult<Self, ()> { - utils::parse_role(s).ok_or_else(|| ()).map(|x| RoleId(x)) + utils::parse_role(s).ok_or_else(|| ()).map(RoleId) } } @@ -134,7 +134,7 @@ impl FromStr for EmojiIdentifier { impl FromStr for ChannelId { type Err = (); fn from_str(s: &str) -> StdResult<Self, ()> { - utils::parse_channel(s).ok_or_else(|| ()).map(|x| ChannelId(x)) + utils::parse_channel(s).ok_or_else(|| ()).map(ChannelId) } } |