Update src/config.rs

Co-authored-by: Eric Huss <eric@huss.org>
This commit is contained in:
josh rotenberg 2021-05-24 11:59:32 -07:00 committed by GitHub
parent 78325aaccb
commit 7a3513200f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 10 deletions

View File

@ -321,16 +321,11 @@ impl<'de> Deserialize<'de> for Config {
}
};
let book = if let Some(book) = table.remove("book") {
match book.try_into() {
Ok(b) => b,
Err(e) => {
return Err(D::Error::custom(e));
}
}
} else {
BookConfig::default()
};
let book: BookConfig = table
.remove("book")
.map(|book| book.try_into().map_err(D::Error::custom))
.transpose()?
.unwrap_or_default();
let build = if let Some(build) = table.remove("build") {
match build.try_into() {