Merge pull request #1 from Phoenix-Chen/master

Fix target os to macos. Add missing imports.
This commit is contained in:
Tochukwu Nkemdilim
2019-10-14 12:42:46 +01:00
committed by GitHub
6 changed files with 9 additions and 11 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
#[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "osx")]
#[cfg(target_os = "macos")]
mod osx;
#[cfg(target_os = "windows")]
mod windows;
+1 -4
View File
@@ -17,10 +17,7 @@ impl Connectivity for WiFi {
.output()
.map_err(|err| WifiConnectionError::FailedToConnect(format!("{}", err)))?;
if !String::from_utf8_lossy(&output.stdout)
.as_ref()
.contains("successfully activated")
{
if String::from_utf8_lossy(&output.stdout).as_ref() != "" {
return Ok(false);
}
+2 -2
View File
@@ -4,13 +4,13 @@ mod windows;
#[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "osx")]
#[cfg(target_os = "macos")]
mod osx;
pub mod prelude {
#[cfg(target_os = "linux")]
pub use super::linux::*;
#[cfg(target_os = "osx")]
#[cfg(target_os = "macos")]
pub use super::osx::*;
#[cfg(target_os = "windows")]
pub use super::windows::*;
+1
View File
@@ -1,3 +1,4 @@
use hotspot::{WifiHotspot, WifiHotspotError};
use connectivity::{Connectivity, WifiConnectionError};
use platforms::WiFi;
use std::process::Command;
+2 -2
View File
@@ -1,13 +1,13 @@
#[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "osx")]
#[cfg(target_os = "macos")]
mod osx;
#[cfg(target_os = "windows")]
mod windows;
#[cfg(target_os = "linux")]
pub use self::linux::{Connection, Linux as WiFi};
#[cfg(target_os = "osx")]
#[cfg(target_os = "macos")]
pub use self::osx::{Connection, Osx as WiFi};
#[cfg(target_os = "windows")]
pub use self::windows::{Connection, Windows as WiFi};
+2 -2
View File
@@ -1,4 +1,4 @@
use platforms::{WifiError, WifiInterface};
use platforms::{Config, WifiError, WifiInterface};
use std::process::Command;
#[derive(Debug)]
@@ -14,7 +14,7 @@ pub struct Osx {
}
impl Osx {
pub fn new(name: &str, config: Option<Config>) -> Self {
pub fn new(config: Option<Config>) -> Self {
Osx {
connection: None,
interface: config.map_or("en0".to_string(), |cfg| {