Fix(Windows/Adapter): Check For Valida String To Detect State
This commit is contained in:
@@ -43,10 +43,7 @@ impl WifiInterface for Windows {
|
|||||||
.output()
|
.output()
|
||||||
.map_err(|err| WifiError::IoError(err))?;
|
.map_err(|err| WifiError::IoError(err))?;
|
||||||
|
|
||||||
Ok(String::from_utf8_lossy(&output.stdout)
|
Ok(!String::from_utf8_lossy(&output.stdout).contains("disconnected"))
|
||||||
.replace(" ", "")
|
|
||||||
.replace("\n", "")
|
|
||||||
.contains("enabled"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Turn on the wireless network adapter.
|
/// Turn on the wireless network adapter.
|
||||||
|
|||||||
Reference in New Issue
Block a user