Skip to content

Commit

Permalink
chore: rustfmt update
Browse files Browse the repository at this point in the history
  • Loading branch information
bbangert committed Aug 29, 2018
1 parent 194df5e commit 583d07a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
3 changes: 1 addition & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
23 changes: 11 additions & 12 deletions src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,18 +402,17 @@ impl DynamoStorage {

pub fn get_user(&self, uaid: &Uuid) -> impl Future<Item = DynamoDbUser, Error = Error> {
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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
Expand Down
6 changes: 5 additions & 1 deletion src/server/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions src/util/send_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 583d07a

Please sign in to comment.