diff options
| author | acdenisSK <[email protected]> | 2017-08-24 15:26:49 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-08-24 16:36:01 +0200 |
| commit | b3a5bc89ad1c09290fb1c15ca3b36fe17c3796f3 (patch) | |
| tree | 315e16f7b252d22b5f832302e722a85c9e6a9b6e /src/voice/streamer.rs | |
| parent | Allow FromStr for User to use REST (#147) (diff) | |
| download | serenity-b3a5bc89ad1c09290fb1c15ca3b36fe17c3796f3.tar.xz serenity-b3a5bc89ad1c09290fb1c15ca3b36fe17c3796f3.zip | |
Revamp `RwLock` usage in the lib
Also not quite sure if they goofed rustfmt or something, but its changes it did were a bit bizarre.
Diffstat (limited to 'src/voice/streamer.rs')
| -rw-r--r-- | src/voice/streamer.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/voice/streamer.rs b/src/voice/streamer.rs index 3f40bae..c8400f0 100644 --- a/src/voice/streamer.rs +++ b/src/voice/streamer.rs @@ -101,11 +101,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)))), }; @@ -131,9 +129,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) }); |