diff options
| author | Maiddog <[email protected]> | 2017-08-26 17:55:43 -0500 |
|---|---|---|
| committer | alex <[email protected]> | 2017-08-27 00:55:43 +0200 |
| commit | 3e0b1032d80a1847558a752e8316d97f9ae58f04 (patch) | |
| tree | ca65390091cb3c0ab98b6497a1447ba69df3d20d /src/model/misc.rs | |
| parent | Use `$crate` for `Args` (diff) | |
| download | serenity-3e0b1032d80a1847558a752e8316d97f9ae58f04.tar.xz serenity-3e0b1032d80a1847558a752e8316d97f9ae58f04.zip | |
Add ability to play DCA and Opus files. (#148)
Diffstat (limited to 'src/model/misc.rs')
| -rw-r--r-- | src/model/misc.rs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/model/misc.rs b/src/model/misc.rs index 3310e4a..dce8491 100644 --- a/src/model/misc.rs +++ b/src/model/misc.rs @@ -90,9 +90,11 @@ impl FromStr for User { fn from_str(s: &str) -> StdResult<Self, Self::Err> { match utils::parse_username(s) { - Some(x) => UserId(x as u64) - .get() - .map_err(|e| UserParseError::Rest(Box::new(e))), + Some(x) => { + UserId(x as u64).get().map_err( + |e| UserParseError::Rest(Box::new(e)), + ) + }, _ => Err(UserParseError::InvalidUsername), } } @@ -161,9 +163,11 @@ impl FromStr for Role { fn from_str(s: &str) -> StdResult<Self, Self::Err> { match utils::parse_role(s) { - Some(x) => match RoleId(x).find() { - Some(user) => Ok(user), - _ => Err(RoleParseError::NotPresentInCache), + Some(x) => { + match RoleId(x).find() { + Some(user) => Ok(user), + _ => Err(RoleParseError::NotPresentInCache), + } }, _ => Err(RoleParseError::InvalidRole), } @@ -242,9 +246,11 @@ impl FromStr for Channel { fn from_str(s: &str) -> StdResult<Self, ()> { match utils::parse_channel(s) { - Some(x) => match ChannelId(x).find() { - Some(channel) => Ok(channel), - _ => Err(()), + Some(x) => { + match ChannelId(x).find() { + Some(channel) => Ok(channel), + _ => Err(()), + } }, _ => Err(()), } |