diff options
| author | Leah <[email protected]> | 2018-03-23 13:54:12 +0100 |
|---|---|---|
| committer | alex <[email protected]> | 2018-03-23 13:54:12 +0100 |
| commit | fdcf44e1463e708cd8b612c183e302db9af0febd (patch) | |
| tree | 1a311f26fb38522ba380881fa6e72c0c2e5c54bc /src/voice | |
| parent | Fix Create(Embed/Message) to be consistent (diff) | |
| download | serenity-fdcf44e1463e708cd8b612c183e302db9af0febd.tar.xz serenity-fdcf44e1463e708cd8b612c183e302db9af0febd.zip | |
Change the way ids and some enums are made (#295)
This makes them easier to be found by tools like rls.
Also update struct inits to use the shorthand version for `x: x`.
Diffstat (limited to 'src/voice')
| -rw-r--r-- | src/voice/connection.rs | 10 | ||||
| -rw-r--r-- | src/voice/handler.rs | 16 | ||||
| -rw-r--r-- | src/voice/manager.rs | 4 | ||||
| -rw-r--r-- | src/voice/streamer.rs | 4 |
4 files changed, 17 insertions, 17 deletions
diff --git a/src/voice/connection.rs b/src/voice/connection.rs index a98dbc7..d447d5c 100644 --- a/src/voice/connection.rs +++ b/src/voice/connection.rs @@ -575,10 +575,10 @@ fn start_threads(client: Arc<Mutex<Client>>, udp: &UdpSocket) -> Result<ThreadIt })?; Ok(ThreadItems { - rx: rx, - udp_close_sender: udp_close_sender, - udp_thread: udp_thread, - ws_close_sender: ws_close_sender, - ws_thread: ws_thread, + rx, + udp_close_sender, + udp_thread, + ws_close_sender, + ws_thread, }) } diff --git a/src/voice/handler.rs b/src/voice/handler.rs index 4124d66..2c9cf48 100644 --- a/src/voice/handler.rs +++ b/src/voice/handler.rs @@ -149,11 +149,11 @@ impl Handler { // Safe as all of these being present was already checked. self.send(VoiceStatus::Connect(ConnectionInfo { - endpoint: endpoint, - guild_id: guild_id, - session_id: session_id, - token: token, - user_id: user_id, + endpoint, + guild_id, + session_id, + token, + user_id, })); true @@ -373,14 +373,14 @@ impl Handler { Handler { channel_id: None, endpoint: None, - guild_id: guild_id, + guild_id, self_deaf: false, self_mute: false, sender: tx, session_id: None, token: None, - user_id: user_id, - ws: ws, + user_id, + ws, } } diff --git a/src/voice/manager.rs b/src/voice/manager.rs index b4b36b0..213a563 100644 --- a/src/voice/manager.rs +++ b/src/voice/manager.rs @@ -31,8 +31,8 @@ impl Manager { pub(crate) fn new(ws: MpscSender<InterMessage>, user_id: UserId) -> Manager { Manager { handlers: HashMap::new(), - user_id: user_id, - ws: ws, + user_id, + ws, } } diff --git a/src/voice/streamer.rs b/src/voice/streamer.rs index c5954c8..3265fb6 100644 --- a/src/voice/streamer.rs +++ b/src/voice/streamer.rs @@ -163,7 +163,7 @@ pub fn dca<P: AsRef<OsStr>>(path: P) -> StdResult<Box<AudioSource>, DcaError> { pub fn opus<R: Read + Send + 'static>(is_stereo: bool, reader: R) -> Box<AudioSource> { Box::new(InputSource { stereo: is_stereo, - reader: reader, + reader, kind: AudioType::Opus, }) } @@ -172,7 +172,7 @@ pub fn opus<R: Read + Send + 'static>(is_stereo: bool, reader: R) -> Box<AudioSo pub fn pcm<R: Read + Send + 'static>(is_stereo: bool, reader: R) -> Box<AudioSource> { Box::new(InputSource { stereo: is_stereo, - reader: reader, + reader, kind: AudioType::Pcm, }) } |