Skip to content

Commit

Permalink
Run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed May 31, 2024
1 parent f5795bb commit 80bbc27
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
28 changes: 16 additions & 12 deletions mullvad-daemon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,11 @@ pub(crate) enum InternalDaemonEvent {
/// A geographical location has has been received from am.i.mullvad.net
LocationEvent(LocationEventData),
/// The split tunnel paths or state were updated.
#[cfg(any(windows, target_os = "android", target_os="macos"))]
#[cfg(any(windows, target_os = "android", target_os = "macos"))]
ExcludedPathsEvent(ExcludedPathsUpdate, oneshot::Sender<Result<(), Error>>),
}

#[cfg(any(windows, target_os = "android", target_os="macos"))]
#[cfg(any(windows, target_os = "android", target_os = "macos"))]
pub(crate) enum ExcludedPathsUpdate {
SetState(bool),
SetPaths(HashSet<SplitApp>),
Expand Down Expand Up @@ -767,7 +767,7 @@ where
PersistentTargetState::new(&cache_dir).await
};

#[cfg(any(windows, target_os = "android", target_os="macos"))]
#[cfg(any(windows, target_os = "android", target_os = "macos"))]
let exclude_paths = if settings.split_tunnel.enable_exclusions {
settings
.split_tunnel
Expand Down Expand Up @@ -811,7 +811,7 @@ where
.map_err(Error::ApiConnectionModeError)?
.endpoint,
reset_firewall: *target_state != TargetState::Secured,
#[cfg(any(windows, target_os = "android", target_os="macos"))]
#[cfg(any(windows, target_os = "android", target_os = "macos"))]
exclude_paths,
},
parameters_generator.clone(),
Expand Down Expand Up @@ -995,7 +995,7 @@ where
} => self.handle_access_method_event(event, endpoint_active_tx),
DeviceMigrationEvent(event) => self.handle_device_migration_event(event),
LocationEvent(location_data) => self.handle_location_event(location_data),
#[cfg(any(windows, target_os = "android", target_os="macos"))]
#[cfg(any(windows, target_os = "android", target_os = "macos"))]
ExcludedPathsEvent(update, tx) => self.handle_new_excluded_paths(update, tx).await,
}
}
Expand Down Expand Up @@ -1274,13 +1274,13 @@ where
RemoveSplitTunnelProcess(tx, pid) => self.on_remove_split_tunnel_process(tx, pid),
#[cfg(target_os = "linux")]
ClearSplitTunnelProcesses(tx) => self.on_clear_split_tunnel_processes(tx),
#[cfg(any(windows, target_os = "android", target_os="macos"))]
#[cfg(any(windows, target_os = "android", target_os = "macos"))]
AddSplitTunnelApp(tx, app) => self.on_add_split_tunnel_app(tx, app),
#[cfg(any(windows, target_os = "android", target_os="macos"))]
#[cfg(any(windows, target_os = "android", target_os = "macos"))]
RemoveSplitTunnelApp(tx, path) => self.on_remove_split_tunnel_app(tx, path),
#[cfg(any(windows, target_os = "android", target_os="macos"))]
#[cfg(any(windows, target_os = "android", target_os = "macos"))]
ClearSplitTunnelApps(tx) => self.on_clear_split_tunnel_apps(tx),
#[cfg(any(windows, target_os = "android", target_os="macos"))]
#[cfg(any(windows, target_os = "android", target_os = "macos"))]
SetSplitTunnelState(tx, enabled) => self.on_set_split_tunnel_state(tx, enabled),
#[cfg(windows)]
GetSplitTunnelProcesses(tx) => self.on_get_split_tunnel_processes(tx),
Expand Down Expand Up @@ -1436,7 +1436,7 @@ where
});
}

#[cfg(any(windows, target_os = "android", target_os="macos"))]
#[cfg(any(windows, target_os = "android", target_os = "macos"))]
async fn handle_new_excluded_paths(
&mut self,
update: ExcludedPathsUpdate,
Expand Down Expand Up @@ -1890,7 +1890,11 @@ where
) {
let tunnel_list = match update {
ExcludedPathsUpdate::SetPaths(ref paths) if settings.split_tunnel.enable_exclusions => {
paths.iter().cloned().map(SplitApp::to_tunnel_command_repr).collect()
paths
.iter()
.cloned()
.map(SplitApp::to_tunnel_command_repr)
.collect()
}
ExcludedPathsUpdate::SetState(true) => settings
.split_tunnel
Expand Down Expand Up @@ -1973,7 +1977,7 @@ where
);
}

#[cfg(any(windows, target_os = "android", target_os="macos"))]
#[cfg(any(windows, target_os = "android", target_os = "macos"))]
fn on_set_split_tunnel_state(&mut self, tx: ResponseTx<(), Error>, state: bool) {
let settings = self.settings.to_settings();
self.set_split_tunnel_paths(
Expand Down
2 changes: 1 addition & 1 deletion mullvad-daemon/src/management_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ impl ManagementService for ManagementServiceImpl {
Ok(Response::new(()))
}

#[cfg(any(windows, target_os = "android", target_os="macos"))]
#[cfg(any(windows, target_os = "android", target_os = "macos"))]
async fn remove_split_tunnel_app(&self, request: Request<String>) -> ServiceResult<()> {
use mullvad_types::settings::SplitApp;
log::debug!("remove_split_tunnel_app");
Expand Down

0 comments on commit 80bbc27

Please sign in to comment.