aboutsummaryrefslogtreecommitdiff
path: root/src/model/channel/mod.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-09-18 17:48:52 -0700
committerZeyla Hellyer <[email protected]>2017-09-18 17:48:52 -0700
commitdae2cb77b407044f44a7a2790d93efba3891854e (patch)
treebef263c4490536cf8b56e988e71dd1aa43bc2696 /src/model/channel/mod.rs
parentFix compiles of a variety of feature combinations (diff)
downloadserenity-dae2cb77b407044f44a7a2790d93efba3891854e.tar.xz
serenity-dae2cb77b407044f44a7a2790d93efba3891854e.zip
Apply rustfmt
Diffstat (limited to 'src/model/channel/mod.rs')
-rw-r--r--src/model/channel/mod.rs53
1 files changed, 18 insertions, 35 deletions
diff --git a/src/model/channel/mod.rs b/src/model/channel/mod.rs
index 824aea7..33912f1 100644
--- a/src/model/channel/mod.rs
+++ b/src/model/channel/mod.rs
@@ -130,11 +130,8 @@ impl Channel {
reaction_type: R)
-> Result<()>
where M: Into<MessageId>, R: Into<ReactionType> {
- self.id().delete_reaction(
- message_id,
- user_id,
- reaction_type,
- )
+ self.id()
+ .delete_reaction(message_id, user_id, reaction_type)
}
/// Edits a [`Message`] in the channel given its Id.
@@ -237,12 +234,8 @@ impl Channel {
after: Option<U>)
-> Result<Vec<User>>
where M: Into<MessageId>, R: Into<ReactionType>, U: Into<UserId> {
- self.id().reaction_users(
- message_id,
- reaction_type,
- limit,
- after,
- )
+ self.id()
+ .reaction_users(message_id, reaction_type, limit, after)
}
/// Retrieves the Id of the inner [`Group`], [`GuildChannel`], or
@@ -348,26 +341,18 @@ impl<'de> Deserialize<'de> for Channel {
};
match kind {
- 0 | 2 => {
- serde_json::from_value::<GuildChannel>(Value::Object(v))
- .map(|x| Channel::Guild(Arc::new(RwLock::new(x))))
- .map_err(DeError::custom)
- },
- 1 => {
- serde_json::from_value::<PrivateChannel>(Value::Object(v))
- .map(|x| Channel::Private(Arc::new(RwLock::new(x))))
- .map_err(DeError::custom)
- },
- 3 => {
- serde_json::from_value::<Group>(Value::Object(v))
- .map(|x| Channel::Group(Arc::new(RwLock::new(x))))
- .map_err(DeError::custom)
- },
- 4 => {
- serde_json::from_value::<ChannelCategory>(Value::Object(v))
- .map(|x| Channel::Category(Arc::new(RwLock::new(x))))
- .map_err(DeError::custom)
- },
+ 0 | 2 => serde_json::from_value::<GuildChannel>(Value::Object(v))
+ .map(|x| Channel::Guild(Arc::new(RwLock::new(x))))
+ .map_err(DeError::custom),
+ 1 => serde_json::from_value::<PrivateChannel>(Value::Object(v))
+ .map(|x| Channel::Private(Arc::new(RwLock::new(x))))
+ .map_err(DeError::custom),
+ 3 => serde_json::from_value::<Group>(Value::Object(v))
+ .map(|x| Channel::Group(Arc::new(RwLock::new(x))))
+ .map_err(DeError::custom),
+ 4 => serde_json::from_value::<ChannelCategory>(Value::Object(v))
+ .map(|x| Channel::Category(Arc::new(RwLock::new(x))))
+ .map_err(DeError::custom),
_ => Err(DeError::custom("Unknown channel type")),
}
}
@@ -445,10 +430,8 @@ impl ChannelType {
struct PermissionOverwriteData {
allow: Permissions,
deny: Permissions,
- #[serde(deserialize_with = "deserialize_u64")]
- id: u64,
- #[serde(rename = "type")]
- kind: String,
+ #[serde(deserialize_with = "deserialize_u64")] id: u64,
+ #[serde(rename = "type")] kind: String,
}
/// A channel-specific permission overwrite for a member or role.