Chore(Refactor): Simplify Imports
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
[package]
|
||||
name = "wifi-cli"
|
||||
name = "wifi-connect"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
authors = ["Tochukwu Nkemdilim <[email protected]>"]
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
extern crate wifi_rs;
|
||||
|
||||
use std::io;
|
||||
use wifi_rs::WiFi;
|
||||
use wifi_rs::prelude::*;
|
||||
use wifi_rs::{prelude::*, WiFi};
|
||||
|
||||
fn main() -> Result<(), io::Error> {
|
||||
let config = Some(Config {
|
||||
@@ -12,13 +9,7 @@ fn main() -> Result<(), io::Error> {
|
||||
let mut wifi = WiFi::new(config);
|
||||
let config = HotspotConfig::new(Some(HotspotBand::Bg), Some(Channel::One));
|
||||
|
||||
wifi.create_hotspot(
|
||||
"test-hotspot",
|
||||
"password",
|
||||
Some(
|
||||
&config
|
||||
)
|
||||
);
|
||||
wifi.create_hotspot("test-hotspot", "password", Some(&config));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[package]
|
||||
name = "wifi-cli"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
authors = ["Tochukwu Nkemdilim <[email protected]>"]
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
extern crate clap;
|
||||
extern crate wifi_rs;
|
||||
|
||||
use clap::{App, Arg};
|
||||
use std::io;
|
||||
use wifi_rs::WiFi;
|
||||
use wifi_rs::prelude::*;
|
||||
use wifi_rs::WiFi;
|
||||
|
||||
fn main() -> Result<(), io::Error> {
|
||||
let matches = App::new("Wi-Fi")
|
||||
@@ -58,4 +55,4 @@ fn main() -> Result<(), io::Error> {
|
||||
println!("Connection Status: {:?}", wifi.connect(ssid, password));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user