diff --git a/src/config.rs b/src/config.rs index 8aebb2c..56cee7c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -20,7 +20,7 @@ impl Defaults { } } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] pub struct Config { #[serde(default = "Defaults::unlock")] pub unlock: bool, @@ -30,7 +30,7 @@ pub struct Config { pub pci_info_map: Option>, } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] pub struct PciInfoMapEntry { pub device_id: u16, pub sub_system_id: u16, diff --git a/src/lib.rs b/src/lib.rs index e05f74d..7de779c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -76,7 +76,11 @@ static LAST_MDEV_UUID: Mutex> = parking_lot::const_mutex(None); static CONFIG: Config = { match fs::read_to_string(DEFAULT_CONFIG_PATH) { Ok(config) => match toml::from_str::(&config) { - Ok(config) => config, + Ok(config) => { + println!("{:?}", config); + + config + } Err(e) => { eprintln!("Failed to decode config: {}", e); diff --git a/src/string_number.rs b/src/string_number.rs index ce21bd4..eb1a6e9 100644 --- a/src/string_number.rs +++ b/src/string_number.rs @@ -33,7 +33,8 @@ impl<'de> Deserialize<'de> for U32 { match u32::from_str_radix(v, radix) { Ok(n) => Ok(Self(n)), Err(e) => Err(D::Error::custom(format!( - "Failed to parse string as base-{radix} integer: {e}" + "Failed to parse string as base-{} integer: {}", + radix, e ))), } }