diff options
| author | acdenisSK <[email protected]> | 2017-10-03 16:55:58 +0200 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-10-09 15:47:48 -0700 |
| commit | 06dc6937bd3d4e5912de08e4ac3630a1f83b7f5a (patch) | |
| tree | eee16dc9d1c35e2b17a0a59d55cc85fa82726587 /src/utils | |
| parent | Use the de-generification trick. (diff) | |
| download | serenity-06dc6937bd3d4e5912de08e4ac3630a1f83b7f5a.tar.xz serenity-06dc6937bd3d4e5912de08e4ac3630a1f83b7f5a.zip | |
Revert "Use the de-generification trick."
Makes the compiliation time just a bit worse
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/message_builder.rs | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/utils/message_builder.rs b/src/utils/message_builder.rs index e1ba328..f58c0b3 100644 --- a/src/utils/message_builder.rs +++ b/src/utils/message_builder.rs @@ -122,12 +122,8 @@ impl MessageBuilder { /// [`ChannelId`]: ../model/struct.ChannelId.html /// [`GuildChannel`]: ../model/struct.GuildChannel.html /// [Display implementation]: ../model/struct.ChannelId.html#method.fmt-1 - pub fn channel<C: Into<ChannelId>>(self, channel: C) -> Self { - self._channel(channel.into()) - } - - fn _channel(mut self, channel: ChannelId) -> Self { - let _ = write!(self.0, "{}", channel.mention()); + pub fn channel<C: Into<ChannelId>>(mut self, channel: C) -> Self { + let _ = write!(self.0, "{}", channel.into().mention()); self } @@ -705,12 +701,8 @@ impl MessageBuilder { /// [`Role`]: ../model/struct.Role.html /// [`RoleId`]: ../model/struct.RoleId.html /// [Display implementation]: ../model/struct.RoleId.html#method.fmt-1 - pub fn role<R: Into<RoleId>>(self, role: R) -> Self { - self._role(role.into()) - } - - fn _role(mut self, role: RoleId) -> Self { - let _ = write!(self.0, "{}", role.mention()); + pub fn role<R: Into<RoleId>>(mut self, role: R) -> Self { + let _ = write!(self.0, "{}", role.into().mention()); self } @@ -726,12 +718,8 @@ impl MessageBuilder { /// [`User`]: ../model/struct.User.html /// [`UserId`]: ../model/struct.UserId.html /// [Display implementation]: ../model/struct.UserId.html#method.fmt-1 - pub fn user<U: Into<UserId>>(self, user: U) -> Self { - self._user(user.into()) - } - - fn _user(mut self, user: UserId) -> Self { - let _ = write!(self.0, "{}", user.mention()); + pub fn user<U: Into<UserId>>(mut self, user: U) -> Self { + let _ = write!(self.0, "{}", user.into().mention()); self } |