From b06338ec1d282a762440ad72c935717e404badca Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Tue, 2 Apr 2019 15:56:06 +0300 Subject: Reorg, sources have names. --- src/wg.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/wg.rs') 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 { - Ok(Device { ifname }) + pub fn new(ifname: OsString) -> io::Result { + let dev = Device { ifname }; + let _ = dev.get_public_key()?; + Ok(dev) } pub fn wg_command() -> Command { -- cgit