Skip to content

Commit

Permalink
Merge pull request #2125 from ehuss/update-toml
Browse files Browse the repository at this point in the history
Update toml to 0.7.6
  • Loading branch information
ehuss authored Jul 16, 2023
2 parents 7824aed + b423bf7 commit 8979706
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 10 deletions.
73 changes: 69 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ serde = { version = "1.0.163", features = ["derive"] }
serde_json = "1.0.96"
shlex = "1.1.0"
tempfile = "3.4.0"
toml = "0.5.11"
toml = "0.7.6"
topological-sort = "0.2.2"

# Watch feature
Expand Down
9 changes: 4 additions & 5 deletions src/book/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,11 @@ impl BookBuilder {
fn write_book_toml(&self) -> Result<()> {
debug!("Writing book.toml");
let book_toml = self.root.join("book.toml");
let cfg = toml::to_vec(&self.config).with_context(|| "Unable to serialize the config")?;
let cfg =
toml::to_string(&self.config).with_context(|| "Unable to serialize the config")?;

File::create(book_toml)
.with_context(|| "Couldn't create book.toml")?
.write_all(&cfg)
.with_context(|| "Unable to write config to book.toml")?;
fs::write(&book_toml, cfg)
.with_context(|| format!("failed to write {}", book_toml.display()))?;
Ok(())
}

Expand Down

0 comments on commit 8979706

Please sign in to comment.