aboutsummaryrefslogtreecommitdiff
path: root/src/builder/create_embed.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-10-03 16:55:58 +0200
committeracdenisSK <[email protected]>2017-10-03 16:55:58 +0200
commit2233337d334e52b5c4cf7149097e70ef5c5433b3 (patch)
treeba14ca714fa7bc1e6ba1d26f10e7c170bdf10ffa /src/builder/create_embed.rs
parentUse the de-generification trick. (diff)
downloadserenity-2233337d334e52b5c4cf7149097e70ef5c5433b3.tar.xz
serenity-2233337d334e52b5c4cf7149097e70ef5c5433b3.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)
}