Skip to content

Commit b423bf7

Browse files
committed
Update toml to 0.7.6
1 parent cdbdb82 commit b423bf7

File tree

3 files changed

+74
-10
lines changed

3 files changed

+74
-10
lines changed

Cargo.lock

Lines changed: 69 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ serde = { version = "1.0.163", features = ["derive"] }
3333
serde_json = "1.0.96"
3434
shlex = "1.1.0"
3535
tempfile = "3.4.0"
36-
toml = "0.5.11"
36+
toml = "0.7.6"
3737
topological-sort = "0.2.2"
3838

3939
# Watch feature

src/book/init.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,11 @@ impl BookBuilder {
9999
fn write_book_toml(&self) -> Result<()> {
100100
debug!("Writing book.toml");
101101
let book_toml = self.root.join("book.toml");
102-
let cfg = toml::to_vec(&self.config).with_context(|| "Unable to serialize the config")?;
102+
let cfg =
103+
toml::to_string(&self.config).with_context(|| "Unable to serialize the config")?;
103104

104-
File::create(book_toml)
105-
.with_context(|| "Couldn't create book.toml")?
106-
.write_all(&cfg)
107-
.with_context(|| "Unable to write config to book.toml")?;
105+
fs::write(&book_toml, cfg)
106+
.with_context(|| format!("failed to write {}", book_toml.display()))?;
108107
Ok(())
109108
}
110109

0 commit comments

Comments
 (0)