aboutsummaryrefslogtreecommitdiff
path: root/src/client/gateway
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-11-29 20:51:10 -0800
committerAustin Hellyer <[email protected]>2016-11-29 22:27:59 -0800
commit93b990d8d1bc9df69b8e27a3db61da570822aad6 (patch)
tree6305cf635df90681527a8e736f65ff19f21fd8bc /src/client/gateway
parentAdd more shiny readme badges (diff)
downloadserenity-93b990d8d1bc9df69b8e27a3db61da570822aad6.tar.xz
serenity-93b990d8d1bc9df69b8e27a3db61da570822aad6.zip
Clean up the codebase
Diffstat (limited to 'src/client/gateway')
-rw-r--r--src/client/gateway/prep.rs21
-rw-r--r--src/client/gateway/shard.rs10
2 files changed, 15 insertions, 16 deletions
diff --git a/src/client/gateway/prep.rs b/src/client/gateway/prep.rs
index 2ca435b..6aa40f3 100644
--- a/src/client/gateway/prep.rs
+++ b/src/client/gateway/prep.rs
@@ -21,10 +21,10 @@ use ::model::event::{Event, GatewayEvent, ReadyEvent};
#[inline]
pub fn parse_ready(event: GatewayEvent,
- tx: &MpscSender<GatewayStatus>,
- receiver: &mut Receiver<WebSocketStream>,
- identification: Value)
- -> Result<(ReadyEvent, u64)> {
+ tx: &MpscSender<GatewayStatus>,
+ receiver: &mut Receiver<WebSocketStream>,
+ identification: Value)
+ -> Result<(ReadyEvent, u64)> {
match event {
GatewayEvent::Dispatch(seq, Event::Ready(event)) => {
Ok((event, seq))
@@ -60,7 +60,7 @@ pub fn identify(token: &str, shard_info: Option<[u8; 2]>) -> Value {
object = identify_compression(object)
.insert("large_threshold", 250) // max value
.insert_object("properties", |object| object
- .insert("$browser", "Feature-full and ergonomic discord rust library")
+ .insert("$browser", "Ergonomic and high-level Rust library")
.insert("$device", "serenity")
.insert("$os", env::consts::OS)
.insert("$referrer", "")
@@ -70,10 +70,9 @@ pub fn identify(token: &str, shard_info: Option<[u8; 2]>) -> Value {
.insert("v", constants::GATEWAY_VERSION);
if let Some(shard_info) = shard_info {
- object = object
- .insert_array("shard", |a| a
- .push(shard_info[0])
- .push(shard_info[1]));
+ object = object.insert_array("shard", |a| a
+ .push(shard_info[0])
+ .push(shard_info[1]));
}
object
@@ -97,8 +96,8 @@ pub fn build_gateway_url(base: &str) -> Result<RequestUrl> {
}
pub fn keepalive(interval: u64,
- mut sender: Sender<WebSocketStream>,
- channel: MpscReceiver<GatewayStatus>) {
+ mut sender: Sender<WebSocketStream>,
+ channel: MpscReceiver<GatewayStatus>) {
let mut base_interval = Duration::milliseconds(interval as i64);
let mut next_tick = time::get_time() + base_interval;
diff --git a/src/client/gateway/shard.rs b/src/client/gateway/shard.rs
index 13a8c06..1464bd3 100644
--- a/src/client/gateway/shard.rs
+++ b/src/client/gateway/shard.rs
@@ -135,9 +135,9 @@ impl Shard {
// Parse READY
let event = try!(receiver.recv_json(GatewayEvent::decode));
let (ready, sequence) = try!(prep::parse_ready(event,
- &tx,
- &mut receiver,
- identification));
+ &tx,
+ &mut receiver,
+ identification));
Ok((feature_voice! {{
Shard {
@@ -512,8 +512,8 @@ impl Shard {
let msg = ObjectBuilder::new()
.insert("op", OpCode::StatusUpdate.num())
.insert_object("d", move |mut object| {
- object = object.insert("since", 0)
- .insert("afk", afk)
+ object = object.insert("afk", afk)
+ .insert("since", 0)
.insert("status", status.name());
match game.as_ref() {