summaryrefslogtreecommitdiffhomepage
path: root/mullvad_daemon
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-04-18 15:22:24 +0200
committerLinus Färnstrand <linus@mullvad.net>2017-04-18 15:22:24 +0200
commit1ff09656b1fe97008fa6efaee6078d35528fcc66 (patch)
tree235f3bbc78f511e93948534f1ec038a2de52807b /mullvad_daemon
parent7b054cf70ef6eaccc3886364fecf8814a541a00b (diff)
downloadmullvadvpn-1ff09656b1fe97008fa6efaee6078d35528fcc66.tar.xz
mullvadvpn-1ff09656b1fe97008fa6efaee6078d35528fcc66.zip
Reformat with new rustfmt settings
Diffstat (limited to 'mullvad_daemon')
-rw-r--r--mullvad_daemon/src/frontend_ipc_router.rs39
1 files changed, 25 insertions, 14 deletions
diff --git a/mullvad_daemon/src/frontend_ipc_router.rs b/mullvad_daemon/src/frontend_ipc_router.rs
index f203a2fe72..aad05cf778 100644
--- a/mullvad_daemon/src/frontend_ipc_router.rs
+++ b/mullvad_daemon/src/frontend_ipc_router.rs
@@ -28,15 +28,20 @@ fn add_route<T, U, F>(router: &mut jsonrpc_core::IoHandler, method: &str, handle
println!("Got rpc request with params {:?}", params);
let parsed_params: T = params.parse()?;
- let response: U = handler(&parsed_params).map_err(|e| {
- error!("Failed responding to RPC request: {}", e);
- jsonrpc_core::Error::internal_error()
- })?;
+ let response: U = handler(&parsed_params)
+ .map_err(
+ |e| {
+ error!("Failed responding to RPC request: {}", e);
+ jsonrpc_core::Error::internal_error()
+ },
+ )?;
- serde_json::to_value(response).map_err(|e| {
- error!("Unable to serialize response to RPC request: {}", e);
- jsonrpc_core::Error::internal_error()
- })
+ serde_json::to_value(response).map_err(
+ |e| {
+ error!("Unable to serialize response to RPC request: {}", e);
+ jsonrpc_core::Error::internal_error()
+ },
+ )
};
router.add_method(method, c);
}
@@ -53,17 +58,23 @@ fn mock_login(request: &LoginRequest) -> Result<::std::collections::HashMap<Stri
if account_number.starts_with("1111") {
// accounts starting with 1111 expire in one month
- reply.insert("paidUntil".to_owned(),
- "2018-12-31T16:00:00.000Z".to_owned());
+ reply.insert(
+ "paidUntil".to_owned(),
+ "2018-12-31T16:00:00.000Z".to_owned(),
+ );
// res.paidUntil = moment().startOf('day').add(15, 'days').toISOString();
} else if account_number.starts_with("2222") {
// expired in 2013
- reply.insert("paidUntil".to_owned(),
- "2012-12-31T16:00:00.000Z".to_owned());
+ reply.insert(
+ "paidUntil".to_owned(),
+ "2012-12-31T16:00:00.000Z".to_owned(),
+ );
} else if account_number.starts_with("3333") {
// expire in 2038
- reply.insert("paidUntil".to_owned(),
- "2037-12-31T16:00:00.000Z".to_owned());
+ reply.insert(
+ "paidUntil".to_owned(),
+ "2037-12-31T16:00:00.000Z".to_owned(),
+ );
} else {
bail!("you are not welcome {}!", account_number)
}