Chleba / netscanner

Terminal Network scanner & diagnostic tool with modern TUI
MIT License
828 stars 19 forks source link

Error on Windows 11 while installing via cargo #38

Open IngoTB303 opened 1 week ago

IngoTB303 commented 1 week ago

error[E0728]: await is only allowed inside async functions and blocks --> C:\Users\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-wifiscanner-0.2.1\src\sys\windows.rs:11:10 | 6 | pub fn scan() -> Result<Vec> { | ---------------------------------- this is not async ... 11 | .await | ^^^^^ only allowed inside async functions and blocks

error[E0277]: std::result::Result<Vec<Wifi>, Error> is not a future --> C:\Users\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-wifiscanner-0.2.1\src\lib.rs:110:24 110 crate::sys::scan().await ------------------ ^^^^^ std::result::Result<Vec<Wifi>, Error> is not a future
this call returns std::result::Result<Vec<Wifi>, Error>
= help: the trait `Future` is not implemented for `std::result::Result<Vec<Wifi>, Error>`, which is required by `std::result::Result<Vec<Wifi>, Error>: IntoFuture`
= note: std::result::Result<Vec<Wifi>, Error> must be a future or must implement `IntoFuture` to be awaited
= note: required for `std::result::Result<Vec<Wifi>, Error>` to implement `IntoFuture`
help: remove the .await 110 - crate::sys::scan().await 110 + crate::sys::scan()

help: alternatively, consider making fn scan asynchronous --> C:\Users\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-wifiscanner-0.2.1\src\sys\windows.rs:6:4 | 6 | pub async fn scan() -> Result<Vec> { | +++++

Compiling clap v4.5.1 Some errors have detailed explanations: E0277, E0728. For more information about an error, try rustc --explain E0277. Compiling pest_derive v2.7.8 error: could not compile tokio-wifiscanner (lib) due to 2 previous errors warning: build failed, waiting for other jobs to finish... error: failed to compile netscanner v0.5.3, intermediate artifacts can be found at C:\Users\<user>\AppData\Local\Temp\cargo-installiaOl9x. To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.

Chleba commented 1 week ago

Hi @IngoTB303, Yes I know about this. It is inside one of the crate that netscanner is using for scanning wifi networks and soon I will removed this crate and I will try to implement some better or at lease my own wifi scanning that will support win & mac (mac because airport is no longer supported in macOS). So If I may ask to either wait after I finish one more feature and do a proper wifi scanning OR you may try install ubuntu or some other distro to install netscanner.

Chleba commented 6 days ago

Hi, @EphemeralSapient create a PR to fix this issue. I will take a look at it ASAP and it should fix this issue for a Windows OS.

Chleba commented 4 days ago

PR with windows support is here: https://github.com/Chleba/netscanner/pull/39