Merge pull request #1 from Phoenix-Chen/master
Fix target os to macos. Add missing imports.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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,3 +1,4 @@
|
||||
use hotspot::{WifiHotspot, WifiHotspotError};
|
||||
use connectivity::{Connectivity, WifiConnectionError};
|
||||
use platforms::WiFi;
|
||||
use std::process::Command;
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user