summaryrefslogtreecommitdiffhomepage
path: root/talpid-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'talpid-core/src')
-rw-r--r--talpid-core/src/routing/linux.rs7
-rw-r--r--talpid-core/src/routing/macos.rs2
-rw-r--r--talpid-core/src/routing/subprocess.rs2
3 files changed, 5 insertions, 6 deletions
diff --git a/talpid-core/src/routing/linux.rs b/talpid-core/src/routing/linux.rs
index 9f33c9401d..e45c469c57 100644
--- a/talpid-core/src/routing/linux.rs
+++ b/talpid-core/src/routing/linux.rs
@@ -142,7 +142,7 @@ impl RouteManager {
cmd = cmd.arg("table").arg(fwmark);
}
- cmd.to_expr()
+ cmd.into_expr()
.run_expr()
.chain_err(|| ErrorKind::FailedToAddRoute)?;
@@ -289,9 +289,8 @@ impl super::RoutingT for RouteManager {
let ip_str: &str = output
.lines()
.find(|line| line.trim().starts_with("default via "))
- .and_then(|line| line.trim().split_whitespace().skip(2).next())
- .map(Ok)
- .unwrap_or(Err(Error::from(ErrorKind::FailedToGetDefaultRoute)))?;
+ .and_then(|line| line.trim().split_whitespace().nth(2))
+ .ok_or_else(|| Error::from(ErrorKind::FailedToGetDefaultRoute))?;
ip_str
.parse()
diff --git a/talpid-core/src/routing/macos.rs b/talpid-core/src/routing/macos.rs
index 7663ad1bd8..6928084273 100644
--- a/talpid-core/src/routing/macos.rs
+++ b/talpid-core/src/routing/macos.rs
@@ -50,7 +50,7 @@ impl RouteManager {
NetNode::Device(device) => cmd.arg("-interface").arg(&device),
};
- cmd.to_expr()
+ cmd.into_expr()
.run_expr()
.chain_err(|| ErrorKind::FailedToAddRoute)?;
self.set_routes.insert(route);
diff --git a/talpid-core/src/routing/subprocess.rs b/talpid-core/src/routing/subprocess.rs
index d569f0191b..8b6292c1b4 100644
--- a/talpid-core/src/routing/subprocess.rs
+++ b/talpid-core/src/routing/subprocess.rs
@@ -40,7 +40,7 @@ impl Exec {
self
}
- pub fn to_expr(self) -> Expression {
+ pub fn into_expr(self) -> Expression {
duct::cmd(self.cmd, self.args)
}
}