diff options
| author | Zeyla Hellyer <[email protected]> | 2017-08-18 16:14:32 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-08-18 17:52:53 -0700 |
| commit | e4113570967a1fb13539efbfa2cf7285b19d95ba (patch) | |
| tree | 06bb020fcfaa5f8323454dfb525272314a900186 /src/voice/streamer.rs | |
| parent | Move Clippy lints to a cfg_attr (diff) | |
| download | serenity-e4113570967a1fb13539efbfa2cf7285b19d95ba.tar.xz serenity-e4113570967a1fb13539efbfa2cf7285b19d95ba.zip | |
Apply rustfmt
Diffstat (limited to 'src/voice/streamer.rs')
| -rw-r--r-- | src/voice/streamer.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/voice/streamer.rs b/src/voice/streamer.rs index c8400f0..3f40bae 100644 --- a/src/voice/streamer.rs +++ b/src/voice/streamer.rs @@ -101,9 +101,11 @@ pub fn ytdl(uri: &str) -> Result<Box<AudioSource>> { }; let uri = match obj.remove("url") { - Some(v) => match v { - Value::String(uri) => uri, - other => return Err(Error::Voice(VoiceError::YouTubeDLUrl(other))), + Some(v) => { + match v { + Value::String(uri) => uri, + other => return Err(Error::Voice(VoiceError::YouTubeDLUrl(other))), + } }, None => return Err(Error::Voice(VoiceError::YouTubeDLUrl(Value::Object(obj)))), }; @@ -129,9 +131,9 @@ fn is_stereo(path: &OsStr) -> Result<bool> { .ok_or(Error::Voice(VoiceError::Streams))?; let check = streams.iter().any(|stream| { - let channels = stream - .as_object() - .and_then(|m| m.get("channels").and_then(|v| v.as_i64())); + let channels = stream.as_object().and_then(|m| { + m.get("channels").and_then(|v| v.as_i64()) + }); channels == Some(2) }); |