Skip to content

Commit

Permalink
Update src/config.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Huss <eric@huss.org>
  • Loading branch information
2 people authored and rubenmoor committed Aug 5, 2022
1 parent 5377546 commit c929d5e
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit c929d5e

Please sign in to comment.