diff options
| author | David Lönnhager <david.l@mullvad.net> | 2024-03-09 12:29:13 +0100 |
|---|---|---|
| committer | David Lönnhager <dv.lnh.d@gmail.com> | 2024-03-11 13:03:10 +0100 |
| commit | f043b32b9b587ce3b3da97ab903247fd403c3b80 (patch) | |
| tree | 3c66bc3f5bf9699fe7dd6e3b8b5c75c09ebb4a11 | |
| parent | 733b41e94ca123090e79910e3b577c1b282e081f (diff) | |
| download | mullvadvpn-f043b32b9b587ce3b3da97ab903247fd403c3b80.tar.xz mullvadvpn-f043b32b9b587ce3b3da97ab903247fd403c3b80.zip | |
Remove unnecessary mutability
| -rw-r--r-- | talpid-routing/src/unix/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/talpid-routing/src/unix/mod.rs b/talpid-routing/src/unix/mod.rs index d8ab85627a..1cdf9fc26c 100644 --- a/talpid-routing/src/unix/mod.rs +++ b/talpid-routing/src/unix/mod.rs @@ -289,7 +289,7 @@ impl RouteManager { } /// Applies the given routes until [`RouteManager::stop`] is called. - pub async fn add_routes(&mut self, routes: HashSet<RequiredRoute>) -> Result<(), Error> { + pub async fn add_routes(&self, routes: HashSet<RequiredRoute>) -> Result<(), Error> { let tx = self.get_command_tx()?; let (result_tx, result_rx) = oneshot::channel(); tx.unbounded_send(RouteManagerCommand::AddRoutes(routes, result_tx)) @@ -302,7 +302,7 @@ impl RouteManager { } /// Removes all routes previously applied in [`RouteManager::add_routes`]. - pub fn clear_routes(&mut self) -> Result<(), Error> { + pub fn clear_routes(&self) -> Result<(), Error> { let tx = self.get_command_tx()?; tx.unbounded_send(RouteManagerCommand::ClearRoutes) .map_err(|_| Error::RouteManagerDown) @@ -310,13 +310,13 @@ impl RouteManager { /// Ensure that packets are routed using the correct tables. #[cfg(target_os = "linux")] - pub async fn create_routing_rules(&mut self, enable_ipv6: bool) -> Result<(), Error> { + pub async fn create_routing_rules(&self, enable_ipv6: bool) -> Result<(), Error> { self.handle()?.create_routing_rules(enable_ipv6).await } /// Remove any routing rules created by [Self::create_routing_rules]. #[cfg(target_os = "linux")] - pub async fn clear_routing_rules(&mut self) -> Result<(), Error> { + pub async fn clear_routing_rules(&self) -> Result<(), Error> { self.handle()?.clear_routing_rules().await } |
