aboutsummaryrefslogtreecommitdiff
path: root/src/model/channel/embed.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-07-27 06:42:48 +0200
committeracdenisSK <[email protected]>2017-07-27 07:30:23 +0200
commit550030264952f0e0043b63f4582bb817ef8bbf37 (patch)
treeb921e2f78fd603a5ca671623083a32806fd16090 /src/model/channel/embed.rs
parentUse a consistent indentation style (diff)
downloadserenity-550030264952f0e0043b63f4582bb817ef8bbf37.tar.xz
serenity-550030264952f0e0043b63f4582bb817ef8bbf37.zip
rustfmt
Diffstat (limited to 'src/model/channel/embed.rs')
-rw-r--r--src/model/channel/embed.rs28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/model/channel/embed.rs b/src/model/channel/embed.rs
index c0ac1e4..5aea7b0 100644
--- a/src/model/channel/embed.rs
+++ b/src/model/channel/embed.rs
@@ -1,9 +1,9 @@
-#[cfg(feature="utils")]
-use ::utils::Colour;
-#[cfg(feature="model")]
-use ::internal::prelude::*;
-#[cfg(feature="model")]
-use ::builder::CreateEmbed;
+#[cfg(feature = "utils")]
+use utils::Colour;
+#[cfg(feature = "model")]
+use internal::prelude::*;
+#[cfg(feature = "model")]
+use builder::CreateEmbed;
/// Represents a rich embed which allows using richer markdown, multiple fields
/// and more. This was heavily inspired by [slack's attachments].
@@ -20,12 +20,12 @@ pub struct Embed {
/// Information about the author of the embed.
pub author: Option<EmbedAuthor>,
/// The colour code of the embed.
- #[cfg(feature="utils")]
- #[serde(default, rename="color")]
+ #[cfg(feature = "utils")]
+ #[serde(default, rename = "color")]
pub colour: Colour,
/// The colour code of the embed.
- #[cfg(not(feature="utils"))]
- #[serde(default, rename="color")]
+ #[cfg(not(feature = "utils"))]
+ #[serde(default, rename = "color")]
pub colour: u32,
/// The description of the embed.
///
@@ -42,7 +42,7 @@ pub struct Embed {
pub image: Option<EmbedImage>,
/// The type of the embed. For embeds not generated by Discord's backend,
/// this will always be "rich".
- #[serde(rename="type")]
+ #[serde(rename = "type")]
pub kind: String,
/// Provider information for the embed.
///
@@ -63,7 +63,7 @@ pub struct Embed {
pub video: Option<EmbedVideo>,
}
-#[cfg(feature="model")]
+#[cfg(feature = "model")]
impl Embed {
/// Creates a fake Embed, giving back a `serde_json` map.
///
@@ -87,7 +87,9 @@ impl Embed {
/// .inline(false)));
/// ```
#[inline]
- pub fn fake<F>(f: F) -> Value where F: FnOnce(CreateEmbed) -> CreateEmbed {
+ pub fn fake<F>(f: F) -> Value
+ where
+ F: FnOnce(CreateEmbed) -> CreateEmbed, {
Value::Object(f(CreateEmbed::default()).0)
}
}