diff options
| author | Zeyla Hellyer <[email protected]> | 2017-08-18 16:14:32 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-08-18 17:52:53 -0700 |
| commit | e4113570967a1fb13539efbfa2cf7285b19d95ba (patch) | |
| tree | 06bb020fcfaa5f8323454dfb525272314a900186 /src/gateway | |
| parent | Move Clippy lints to a cfg_attr (diff) | |
| download | serenity-e4113570967a1fb13539efbfa2cf7285b19d95ba.tar.xz serenity-e4113570967a1fb13539efbfa2cf7285b19d95ba.zip | |
Apply rustfmt
Diffstat (limited to 'src/gateway')
| -rw-r--r-- | src/gateway/shard.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gateway/shard.rs b/src/gateway/shard.rs index ccb3f85..533d1f4 100644 --- a/src/gateway/shard.rs +++ b/src/gateway/shard.rs @@ -12,7 +12,7 @@ use websocket::stream::sync::AsTcpStream; use websocket::sync::client::{Client, ClientBuilder}; use websocket::sync::stream::{TcpStream, TlsStream}; use websocket::WebSocketError; -use constants::{self, close_codes, OpCode}; +use constants::{self, OpCode, close_codes}; use internal::prelude::*; use internal::ws_impl::SenderExt; use model::event::{Event, GatewayEvent}; @@ -137,7 +137,8 @@ impl Shard { let stage = ConnectionStage::Handshake; let session_id = None; - let mut shard = feature_voice! {{ + let mut shard = + feature_voice! {{ let (tx, rx) = mpsc::channel(); let user = http::get_current_user()?; @@ -470,7 +471,8 @@ impl Shard { return Err(Error::Gateway(GatewayError::OverloadedShard)); }, - Some(4006) | Some(close_codes::SESSION_TIMEOUT) => { + Some(4006) | + Some(close_codes::SESSION_TIMEOUT) => { info!("[Shard {:?}] Invalid session", self.shard_info); self.session_id = None; @@ -740,9 +742,10 @@ impl Shard { }, Err(why) => { match why { - Error::WebSocket(WebSocketError::IoError(err)) => if err.raw_os_error() != - Some(32) { - debug!("[Shard {:?}] Err w/ heartbeating: {:?}", self.shard_info, err); + Error::WebSocket(WebSocketError::IoError(err)) => { + if err.raw_os_error() != Some(32) { + debug!("[Shard {:?}] Err w/ heartbeating: {:?}", self.shard_info, err); + } }, other => { warn!("[Shard {:?}] Other err w/ keepalive: {:?}", self.shard_info, other); @@ -936,8 +939,7 @@ fn connect(base_url: &str) -> Result<WsClient> { fn set_client_timeout(client: &mut WsClient) -> Result<()> { let stream = client.stream_ref().as_tcp(); - stream - .set_read_timeout(Some(StdDuration::from_millis(100)))?; + stream.set_read_timeout(Some(StdDuration::from_millis(100)))?; stream.set_write_timeout(Some(StdDuration::from_secs(5)))?; Ok(()) |