From 06dc6937bd3d4e5912de08e4ac3630a1f83b7f5a Mon Sep 17 00:00:00 2001 From: acdenisSK Date: Tue, 3 Oct 2017 16:55:58 +0200 Subject: Revert "Use the de-generification trick." Makes the compiliation time just a bit worse --- src/utils/message_builder.rs | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'src/utils') 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>(self, channel: C) -> Self { - self._channel(channel.into()) - } - - fn _channel(mut self, channel: ChannelId) -> Self { - let _ = write!(self.0, "{}", channel.mention()); + pub fn channel>(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>(self, role: R) -> Self { - self._role(role.into()) - } - - fn _role(mut self, role: RoleId) -> Self { - let _ = write!(self.0, "{}", role.mention()); + pub fn role>(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>(self, user: U) -> Self { - self._user(user.into()) - } - - fn _user(mut self, user: UserId) -> Self { - let _ = write!(self.0, "{}", user.mention()); + pub fn user>(mut self, user: U) -> Self { + let _ = write!(self.0, "{}", user.into().mention()); self } -- cgit v1.2.3