Skip to content

Commit

Permalink
update build and rust config change
Browse files Browse the repository at this point in the history
  • Loading branch information
joshrotenberg authored and rubenmoor committed Aug 5, 2022
1 parent c929d5e commit 1328ce7
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,27 +327,17 @@ impl<'de> Deserialize<'de> for Config {
.transpose()?
.unwrap_or_default();

let build = if let Some(build) = table.remove("build") {
match build.try_into() {
Ok(b) => b,
Err(e) => {
return Err(D::Error::custom(e));
}
}
} else {
BuildConfig::default()
};
let build: BuildConfig = table
.remove("build")
.map(|build| build.try_into().map_err(D::Error::custom))
.transpose()?
.unwrap_or_default();

let rust = if let Some(rust) = table.remove("rust") {
match rust.try_into() {
Ok(b) => b,
Err(e) => {
return Err(D::Error::custom(e));
}
}
} else {
RustConfig::default()
};
let rust: RustConfig = table
.remove("rust")
.map(|rust| rust.try_into().map_err(D::Error::custom))
.transpose()?
.unwrap_or_default();

Ok(Config {
book,
Expand Down

0 comments on commit 1328ce7

Please sign in to comment.