summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-07-21 09:30:48 +0200
committerLinus Färnstrand <linus@mullvad.net>2017-07-21 09:30:48 +0200
commitbcccb537e815b20f55c8629f0d597bf339c8f6a3 (patch)
treef0c0a3f2ec008621e3ebaa17e7a970b865b742c0
parent089b89a1d0701120808ade897e16032c1397b778 (diff)
downloadmullvadvpn-bcccb537e815b20f55c8629f0d597bf339c8f6a3.tar.xz
mullvadvpn-bcccb537e815b20f55c8629f0d597bf339c8f6a3.zip
Make get_library_extension return &'static str
-rw-r--r--talpid-core/src/tunnel/mod.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/talpid-core/src/tunnel/mod.rs b/talpid-core/src/tunnel/mod.rs
index bbdd8919a8..b8d91c567e 100644
--- a/talpid-core/src/tunnel/mod.rs
+++ b/talpid-core/src/tunnel/mod.rs
@@ -135,18 +135,16 @@ impl TunnelMonitor {
}
}
- fn get_library_extension() -> Result<String> {
- let ext = if cfg!(target_os = "macos") {
- "dylib"
+ fn get_library_extension() -> Result<&'static str> {
+ if cfg!(target_os = "macos") {
+ Ok("dylib")
} else if cfg!(unix) {
- "so"
+ Ok("so")
} else if cfg!(windows) {
- "dll"
+ Ok("dll")
} else {
bail!(ErrorKind::UnsupportedPlatform);
- };
-
- Ok(ext.to_owned())
+ }
}
fn get_config_path() -> Option<PathBuf> {