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/builder/create_embed.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/builder/create_embed.rs') diff --git a/src/builder/create_embed.rs b/src/builder/create_embed.rs index 7303693..a128c91 100644 --- a/src/builder/create_embed.rs +++ b/src/builder/create_embed.rs @@ -62,20 +62,14 @@ impl CreateEmbed { /// [`colour`]: #method.colour #[cfg(feature = "utils")] #[inline] - pub fn color>(self, colour: C) -> Self { self.colour(colour) } + pub fn color>(self, colour: C) -> Self { self.colour(colour.into()) } - /// Set the colour of the left-hand side of the embed. #[cfg(feature = "utils")] pub fn colour>(mut self, colour: C) -> Self { - self._colour(colour.into()) - } - - #[cfg(feature = "utils")] - fn _colour(mut self, colour: Colour) -> Self { self.0.insert( "color".to_string(), - Value::Number(Number::from(colour.0 as u64)), + Value::Number(Number::from(colour.into().0 as u64)), ); CreateEmbed(self.0) @@ -288,12 +282,8 @@ impl CreateEmbed { /// let mut client = Client::new("token", Handler); client.start().unwrap(); /// ``` pub fn timestamp>(mut self, timestamp: T) -> Self { - self._timestamp(timestamp.into()) - } - - fn _timestamp(mut self, timestamp: Timestamp) -> Self { self.0 - .insert("timestamp".to_string(), Value::String(timestamp.ts)); + .insert("timestamp".to_string(), Value::String(timestamp.into().ts)); CreateEmbed(self.0) } -- cgit v1.2.3