diff --git a/src/client.rs b/src/client.rs index b4d3f206b..dda11f651 100644 --- a/src/client.rs +++ b/src/client.rs @@ -406,8 +406,7 @@ where flags.check = check_storage; flags.reset_uaid = reset_uaid; flags.rotate_message_table = rotate_message_table; - let (initialized_subs, broadcasts) = - srv.broadcast_init(&desired_broadcasts); + let (initialized_subs, broadcasts) = srv.broadcast_init(&desired_broadcasts); broadcast_subs.replace(initialized_subs); let uid = Uuid::new_v4(); let webpush = Rc::new(RefCell::new(WebPushClient { diff --git a/src/db/mod.rs b/src/db/mod.rs index fbfc80135..5cca3e717 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -402,18 +402,17 @@ impl DynamoStorage { pub fn get_user(&self, uaid: &Uuid) -> impl Future { let ddb = self.ddb.clone(); - let result = commands::get_uaid(ddb, uaid, &self.router_table_name) - .and_then(|result| { - future::result( - result - .item - .ok_or_else(|| "No user record found".into()) - .and_then(|item| { - let user = serde_dynamodb::from_hashmap(item); - user.chain_err(|| "Error deserializing") - }), - ) - }); + let result = commands::get_uaid(ddb, uaid, &self.router_table_name).and_then(|result| { + future::result( + result + .item + .ok_or_else(|| "No user record found".into()) + .and_then(|item| { + let user = serde_dynamodb::from_hashmap(item); + user.chain_err(|| "Error deserializing") + }), + ) + }); Box::new(result) } } diff --git a/src/http.rs b/src/http.rs index 7ae901f0e..56df8825e 100644 --- a/src/http.rs +++ b/src/http.rs @@ -74,7 +74,7 @@ impl Service for Push { response.set_status(StatusCode::BadGateway); response.set_body("Client not available."); } - }, + } (_, "push", _) | (_, "notif", _) => response.set_status(StatusCode::MethodNotAllowed), _ => response.set_status(StatusCode::NotFound), }; diff --git a/src/server/dispatch.rs b/src/server/dispatch.rs index ee4e6c604..3f3258cb6 100644 --- a/src/server/dispatch.rs +++ b/src/server/dispatch.rs @@ -77,7 +77,11 @@ impl Future for Dispatch { RequestType::Websocket } else { match req.path { - Some(ref path) if path.starts_with("/status") || *path == "/__heartbeat__" => RequestType::Status, + Some(ref path) + if path.starts_with("/status") || *path == "/__heartbeat__" => + { + RequestType::Status + } Some(ref path) if *path == "/__lbheartbeat__" => RequestType::LBHeartBeat, Some(ref path) if *path == "/__version__" => RequestType::Version, Some(ref path) if path.starts_with("/v1/err/crit") => RequestType::LogCheck, diff --git a/src/util/send_all.rs b/src/util/send_all.rs index bc1bdec05..558757071 100644 --- a/src/util/send_all.rs +++ b/src/util/send_all.rs @@ -39,10 +39,12 @@ where } fn take_result(&mut self) -> (T, U) { - let sink = self.sink + let sink = self + .sink .take() .expect("Attempted to poll MySendAll after completion"); - let fuse = self.stream + let fuse = self + .stream .take() .expect("Attempted to poll MySendAll after completion"); (fuse.into_inner(), sink)