aboutsummaryrefslogtreecommitdiff
path: root/src/voice
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-01-27 21:05:20 -0800
committerZeyla Hellyer <[email protected]>2018-01-27 21:05:20 -0800
commit13b0de121eda30e59849fd442c8a0926a63df2b8 (patch)
treed625052bca668b7b92016eb819a8b1b2ca5e475f /src/voice
parentCorrectly set role's position on new roles (diff)
downloadserenity-13b0de121eda30e59849fd442c8a0926a63df2b8.tar.xz
serenity-13b0de121eda30e59849fd442c8a0926a63df2b8.zip
Reduce number of clones in the library
Diffstat (limited to 'src/voice')
-rw-r--r--src/voice/audio.rs2
-rw-r--r--src/voice/streamer.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/voice/audio.rs b/src/voice/audio.rs
index 24a4fcd..21f8f31 100644
--- a/src/voice/audio.rs
+++ b/src/voice/audio.rs
@@ -24,7 +24,7 @@ pub trait AudioReceiver: Send {
data: &[i16]);
}
-#[derive(Clone)]
+#[derive(Clone, Copy)]
pub enum AudioType {
Opus,
Pcm,
diff --git a/src/voice/streamer.rs b/src/voice/streamer.rs
index 99be4de..a0334f3 100644
--- a/src/voice/streamer.rs
+++ b/src/voice/streamer.rs
@@ -25,7 +25,7 @@ struct InputSource<R: Read + Send + 'static> {
impl<R: Read + Send> AudioSource for InputSource<R> {
fn is_stereo(&mut self) -> bool { self.stereo }
- fn get_type(&self) -> AudioType { self.kind.clone() }
+ fn get_type(&self) -> AudioType { self.kind }
fn read_pcm_frame(&mut self, buffer: &mut [i16]) -> Option<usize> {
for (i, v) in buffer.iter_mut().enumerate() {