diff --git a/src/config.rs b/src/config.rs index c7fb752..3c4ba9f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -3,12 +3,11 @@ use std::fmt::{Debug, Formatter}; use std::fs::File; use std::io::Read; -#[derive(Default, Debug, Deserialize, Serialize)] +#[derive(Debug, Deserialize, Serialize)] pub enum AuthMethod { None, WEP, WPA, - #[default] WPA2Personal, WPAWPA2Personal, WPA2Enterprise, @@ -20,7 +19,7 @@ pub enum AuthMethod { #[derive(Deserialize)] pub struct Wifi { pub ssid: String, - pub auth_method: AuthMethod, + pub auth_method: Option, // TODO: provide a default way of not storing plaintext? while the key is probably going to // be in the repo or somewhere, but at least they need to know in order to decode? pub password: Option, diff --git a/src/main.rs b/src/main.rs index 6c8ec88..4aa61f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -84,7 +84,7 @@ async fn run_async(spawner: LocalSpawner) -> Result<(), anyhow::Error> { &WifiConfig { ssid: config.wifi.ssid.clone(), password: config.wifi.password.clone(), - auth_method: Some(AuthMethod::from(&config.wifi.auth_method)), + auth_method: config.wifi.auth_method.as_ref().map(AuthMethod::from), }, peripherals.modem, )?;