forked from msrd0/mkalpiimg
fix failure on missing value that has default
This commit is contained in:
parent
47c2c003d1
commit
c88b1e2187
1 changed files with 13 additions and 0 deletions
|
@ -11,8 +11,12 @@ use std::{
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
pub struct Os {
|
pub struct Os {
|
||||||
pub alpine: Alpine,
|
pub alpine: Alpine,
|
||||||
|
|
||||||
|
#[serde(default)]
|
||||||
pub rpi: Rpi,
|
pub rpi: Rpi,
|
||||||
|
|
||||||
pub host: Host,
|
pub host: Host,
|
||||||
|
|
||||||
pub user: Vec<User>
|
pub user: Vec<User>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,6 +176,15 @@ pub struct Rpi {
|
||||||
pub usercfg: String
|
pub usercfg: String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for Rpi {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
cmdline: default_cmdline(),
|
||||||
|
usercfg: default_usercfg()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn default_hostname() -> String {
|
fn default_hostname() -> String {
|
||||||
"alpi".into()
|
"alpi".into()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue