aboutsummaryrefslogtreecommitdiff
path: root/src/wg.rs
diff options
context:
space:
mode:
authorHristo Venev <hristo@venev.name>2019-04-02 15:56:06 +0300
committerHristo Venev <hristo@venev.name>2019-04-02 15:57:45 +0300
commitb06338ec1d282a762440ad72c935717e404badca (patch)
treef6e441e97f7676e1acab6fc4ba72c3b875e97d9b /src/wg.rs
parentc3269142f8d6c016ce8100b86fcae2031b145a9a (diff)
Reorg, sources have names.
Diffstat (limited to 'src/wg.rs')
-rw-r--r--src/wg.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wg.rs b/src/wg.rs
index b3ec451..745c7b4 100644
--- a/src/wg.rs
+++ b/src/wg.rs
@@ -8,13 +8,15 @@ use std::process::{Command, Stdio};
use std::{env, io};
pub struct Device {
- ifname: String,
+ ifname: OsString,
}
impl Device {
#[inline]
- pub fn new(ifname: String) -> io::Result<Self> {
- Ok(Device { ifname })
+ pub fn new(ifname: OsString) -> io::Result<Self> {
+ let dev = Device { ifname };
+ let _ = dev.get_public_key()?;
+ Ok(dev)
}
pub fn wg_command() -> Command {