Skip to content

Commit

Permalink
Merge pull request #170 from dtolnay/toml
Browse files Browse the repository at this point in the history
Update toml crate to 0.6
  • Loading branch information
dtolnay committed Jan 24, 2023
2 parents e622eb9 + 3876b59 commit 50d5b52
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 5 deletions.
47 changes: 45 additions & 2 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 @@ -28,7 +28,7 @@ syn = { version = "1.0", default-features = false, features = ["full", "parsing"
syn-select = "0.2.1"
tempfile = "3.0"
termcolor = "1.0"
toml = "0.5"
toml = "0.6"
toolchain_find = "0.2"

[package.metadata.docs.rs]
Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ fn try_deserialize() -> Option<Config> {
.map(|name| cargo_home.join(name))
.find(|path| path.exists())?;

let content = fs::read(&config_path).ok()?;
let content = fs::read_to_string(&config_path).ok()?;

let full_config: Sections = match toml::from_slice(&content) {
let full_config: Sections = match toml::from_str(&content) {
Ok(config) => config,
Err(err) => {
_ = writeln!(io::stderr(), "Warning: {}: {}", config_path.display(), err);
Expand Down

0 comments on commit 50d5b52

Please sign in to comment.