diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-12-04 11:12:49 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-12-04 12:19:36 +0100 |
| commit | 6f3ea40d003400a4b5802f12e119805c7f9b3fb7 (patch) | |
| tree | 7cdd9f74729e1aa473ce0ecae121784073a293f1 /mullvad-daemon/src | |
| parent | 26d9f85b9c779ca18f935df9006ca6fad037aeb7 (diff) | |
| download | mullvadvpn-6f3ea40d003400a4b5802f12e119805c7f9b3fb7.tar.xz mullvadvpn-6f3ea40d003400a4b5802f12e119805c7f9b3fb7.zip | |
Upgrade rustfmt to 0.2.17
Diffstat (limited to 'mullvad-daemon/src')
| -rw-r--r-- | mullvad-daemon/src/bin/problem-report.rs | 4 | ||||
| -rw-r--r-- | mullvad-daemon/src/main.rs | 8 | ||||
| -rw-r--r-- | mullvad-daemon/src/management_interface.rs | 10 | ||||
| -rw-r--r-- | mullvad-daemon/src/relays.rs | 4 | ||||
| -rw-r--r-- | mullvad-daemon/src/rpc_info.rs | 4 |
5 files changed, 11 insertions, 19 deletions
diff --git a/mullvad-daemon/src/bin/problem-report.rs b/mullvad-daemon/src/bin/problem-report.rs index 11b5e0688c..b7324ae866 100644 --- a/mullvad-daemon/src/bin/problem-report.rs +++ b/mullvad-daemon/src/bin/problem-report.rs @@ -370,9 +370,7 @@ fn command_stdout_lossy(cmd: &str, args: &[&str]) -> Option<String> { Command::new(cmd) .args(args) .output() - .map(|output| { - String::from_utf8_lossy(&output.stdout).trim().to_string() - }) + .map(|output| String::from_utf8_lossy(&output.stdout).trim().to_string()) .ok() } diff --git a/mullvad-daemon/src/main.rs b/mullvad-daemon/src/main.rs index c1c7aa4980..f82a668940 100644 --- a/mullvad-daemon/src/main.rs +++ b/mullvad-daemon/src/main.rs @@ -125,7 +125,8 @@ const DATE_TIME_FORMAT_STR: &str = "%Y-%m-%d %H:%M:%S%.3f"; pub enum DaemonEvent { /// An event coming from the tunnel software to indicate a change in state. TunnelEvent(TunnelEvent), - /// Triggered by the thread waiting for the tunnel process. Means the tunnel process exited. + /// Triggered by the thread waiting for the tunnel process. Means the tunnel process + /// exited. TunnelExited(tunnel::Result<()>), /// Triggered by the thread waiting for a tunnel close operation to complete. Contains the /// result of trying to kill the tunnel. @@ -264,9 +265,8 @@ impl Daemon { event_tx: IntoSender<TunnelCommand, DaemonEvent>, ) -> Result<ManagementInterfaceServer> { let shared_secret = uuid::Uuid::new_v4().to_string(); - let server = ManagementInterfaceServer::start(event_tx, shared_secret.clone()).chain_err( - || ErrorKind::ManagementInterfaceError("Failed to start server"), - )?; + let server = ManagementInterfaceServer::start(event_tx, shared_secret.clone()) + .chain_err(|| ErrorKind::ManagementInterfaceError("Failed to start server"))?; info!( "Mullvad management interface listening on {}", server.address() diff --git a/mullvad-daemon/src/management_interface.rs b/mullvad-daemon/src/management_interface.rs index 1f56d5ba0d..58f62b1ede 100644 --- a/mullvad-daemon/src/management_interface.rs +++ b/mullvad-daemon/src/management_interface.rs @@ -397,9 +397,9 @@ impl<T: From<TunnelCommand> + 'static + Send> ManagementInterfaceApi for Managem trace!("set_account"); try_future!(self.check_auth(&meta)); let (tx, rx) = sync::oneshot::channel(); - let future = self.send_command_to_daemon( - TunnelCommand::SetAccount(tx, account_token.clone()), - ).and_then(|_| rx.map_err(|_| Error::internal_error())); + let future = + self.send_command_to_daemon(TunnelCommand::SetAccount(tx, account_token.clone())) + .and_then(|_| rx.map_err(|_| Error::internal_error())); if let Some(new_account_token) = account_token { if let Err(e) = AccountHistory::load().and_then(|mut account_history| { @@ -521,9 +521,7 @@ impl<T: From<TunnelCommand> + 'static + Send> ManagementInterfaceApi for Managem try_future!(self.check_auth(&meta)); Box::new(future::result( AccountHistory::load() - .and_then(|mut account_history| { - account_history.remove_account_token(account_token) - }) + .and_then(|mut account_history| account_history.remove_account_token(account_token)) .map_err(|error| { error!( "Unable to remove account from history: {}", diff --git a/mullvad-daemon/src/relays.rs b/mullvad-daemon/src/relays.rs index b15e32ae07..8ebbf49171 100644 --- a/mullvad-daemon/src/relays.rs +++ b/mullvad-daemon/src/relays.rs @@ -239,9 +239,7 @@ impl RelaySelector { self.rng .choose(&tunnels.openvpn) .cloned() - .map(|openvpn_endpoint| { - TunnelParameters::OpenVpn(openvpn_endpoint) - }) + .map(|openvpn_endpoint| TunnelParameters::OpenVpn(openvpn_endpoint)) } /// Downloads the latest relay list and caches it. This operation is blocking. diff --git a/mullvad-daemon/src/rpc_info.rs b/mullvad-daemon/src/rpc_info.rs index 3bd42d9751..cf9951fc98 100644 --- a/mullvad-daemon/src/rpc_info.rs +++ b/mullvad-daemon/src/rpc_info.rs @@ -31,9 +31,7 @@ lazy_static! { /// Writes down the RPC connection info to some API to a file. pub fn write(rpc_address: &str, shared_secret: &str) -> Result<()> { open_file(RPC_ADDRESS_FILE_PATH.as_path()) - .and_then(|mut file| { - write!(file, "{}\n{}", rpc_address, shared_secret) - }) + .and_then(|mut file| write!(file, "{}\n{}", rpc_address, shared_secret)) .chain_err(|| ErrorKind::WriteFailed(RPC_ADDRESS_FILE_PATH.to_owned()))?; debug!( |
