aboutsummaryrefslogtreecommitdiff
path: root/src/builder/create_embed.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-10-03 16:55:58 +0200
committerZeyla Hellyer <[email protected]>2017-10-09 15:47:48 -0700
commit06dc6937bd3d4e5912de08e4ac3630a1f83b7f5a (patch)
treeeee16dc9d1c35e2b17a0a59d55cc85fa82726587 /src/builder/create_embed.rs
parentUse the de-generification trick. (diff)
downloadserenity-06dc6937bd3d4e5912de08e4ac3630a1f83b7f5a.tar.xz
serenity-06dc6937bd3d4e5912de08e4ac3630a1f83b7f5a.zip
Revert "Use the de-generification trick."
Makes the compiliation time just a bit worse
Diffstat (limited to 'src/builder/create_embed.rs')
-rw-r--r--src/builder/create_embed.rs16
1 files changed, 3 insertions, 13 deletions
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<C: Into<Colour>>(self, colour: C) -> Self { self.colour(colour) }
+ pub fn color<C: Into<Colour>>(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<C: Into<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<T: Into<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)
}