diff options
| author | François Triquet <[email protected]> | 2017-10-05 14:03:18 +0200 |
|---|---|---|
| committer | alex <[email protected]> | 2017-10-05 14:03:18 +0200 |
| commit | 022e35d5b12322bd77bbe74a1a3b2ad319977390 (patch) | |
| tree | 2a47b51a524b9f188e4f0cb8646152eb7600e791 /src/voice | |
| parent | Fix most clippy warnings (diff) | |
| download | serenity-022e35d5b12322bd77bbe74a1a3b2ad319977390.tar.xz serenity-022e35d5b12322bd77bbe74a1a3b2ad319977390.zip | |
Replace slice parametres by IntoIterator (#177)
Fixes #174
Diffstat (limited to 'src/voice')
| -rw-r--r-- | src/voice/connection.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/voice/connection.rs b/src/voice/connection.rs index c134798..09393f6 100644 --- a/src/voice/connection.rs +++ b/src/voice/connection.rs @@ -409,7 +409,12 @@ fn encryption_key(client: &mut Client) -> Result<Key> { } #[inline] -fn has_valid_mode(modes: &[String]) -> bool { modes.iter().any(|s| s == CRYPTO_MODE) } +fn has_valid_mode<'a, T, It> (modes: It) -> bool +where T: PartialEq<&'a str>, + It : IntoIterator<Item=T> +{ + modes.into_iter().any(|s| s == CRYPTO_MODE) +} #[inline] fn start_threads(client: Arc<Mutex<Client>>, udp: &UdpSocket) -> Result<ThreadItems> { |