Update src/config.rs
Co-authored-by: Eric Huss <eric@huss.org>
This commit is contained in:
parent
78325aaccb
commit
7a3513200f
|
@ -321,16 +321,11 @@ impl<'de> Deserialize<'de> for Config {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let book = if let Some(book) = table.remove("book") {
|
let book: BookConfig = table
|
||||||
match book.try_into() {
|
.remove("book")
|
||||||
Ok(b) => b,
|
.map(|book| book.try_into().map_err(D::Error::custom))
|
||||||
Err(e) => {
|
.transpose()?
|
||||||
return Err(D::Error::custom(e));
|
.unwrap_or_default();
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
BookConfig::default()
|
|
||||||
};
|
|
||||||
|
|
||||||
let build = if let Some(build) = table.remove("build") {
|
let build = if let Some(build) = table.remove("build") {
|
||||||
match build.try_into() {
|
match build.try_into() {
|
||||||
|
|
Loading…
Reference in New Issue