diff options
| author | Zeyla Hellyer <[email protected]> | 2017-09-18 17:48:52 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-09-18 17:48:52 -0700 |
| commit | dae2cb77b407044f44a7a2790d93efba3891854e (patch) | |
| tree | bef263c4490536cf8b56e988e71dd1aa43bc2696 /src/voice/streamer.rs | |
| parent | Fix compiles of a variety of feature combinations (diff) | |
| download | serenity-dae2cb77b407044f44a7a2790d93efba3891854e.tar.xz serenity-dae2cb77b407044f44a7a2790d93efba3891854e.zip | |
Apply rustfmt
Diffstat (limited to 'src/voice/streamer.rs')
| -rw-r--r-- | src/voice/streamer.rs | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/voice/streamer.rs b/src/voice/streamer.rs index cf62d27..4702bdb 100644 --- a/src/voice/streamer.rs +++ b/src/voice/streamer.rs @@ -65,12 +65,10 @@ impl<R: Read + Send> AudioSource for InputSource<R> { Some(frame) }, - Err(ref e) => { - if e.kind() == IoErrorKind::UnexpectedEof { - Some(Vec::new()) - } else { - None - } + Err(ref e) => if e.kind() == IoErrorKind::UnexpectedEof { + Some(Vec::new()) + } else { + None }, } } @@ -194,11 +192,9 @@ 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)))), }; @@ -224,9 +220,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) }); |