Skip to content

Commit

Permalink
Merge pull request #1210 from coreos/dependabot/cargo/toml-0.8.15
Browse files Browse the repository at this point in the history
build(deps): bump toml from 0.5.11 to 0.8.15
  • Loading branch information
prestist authored Feb 26, 2025
2 parents 6c30843 + 33ae5f5 commit f507071
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 11 deletions.
45 changes: 41 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 @@ -43,7 +43,7 @@ serde_json = "1.0"
tempfile = ">= 3.7, < 4.0"
thiserror = "2.0"
tokio = { version = "1.42", features = ["signal", "rt", "rt-multi-thread"] }
toml = "0.5"
toml = ">= 0.8, < 0.9"
tzfile = "0.1.3"
url = { version = "2.5", features = ["serde"] }
users = "0.11.0"
Expand Down
4 changes: 2 additions & 2 deletions src/config/fragments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ mod tests {

#[test]
fn basic_dist_config_sample() {
let content = std::fs::read("tests/fixtures/00-config-sample.toml").unwrap();
let cfg: ConfigFragment = toml::from_slice(&content).unwrap();
let content = std::fs::read_to_string("tests/fixtures/00-config-sample.toml").unwrap();
let cfg: ConfigFragment = toml::from_str(&content).unwrap();

let expected = ConfigFragment {
agent: Some(AgentFragment {
Expand Down
4 changes: 2 additions & 2 deletions src/config/inputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ impl ConfigInput {
for (_, fpath) in liboverdrop::scan(dirs, common_path, extensions.as_slice(), true) {
trace!("reading config fragment '{}'", fpath.display());

let content = std::fs::read(&fpath)
let content = std::fs::read_to_string(&fpath)
.with_context(|| format!("failed to read file '{}'", fpath.display()))?;
let frag: fragments::ConfigFragment =
toml::from_slice(&content).context("failed to parse TOML")?;
toml::from_str(&content).context("failed to parse TOML")?;

fragments.push(frag);
}
Expand Down
4 changes: 2 additions & 2 deletions src/strategy/periodic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ mod tests {
}

fn parse_config_input(config_path: &str) -> inputs::ConfigInput {
let content = std::fs::read(config_path).unwrap();
let frag: fragments::ConfigFragment = toml::from_slice(&content).unwrap();
let content = std::fs::read_to_string(config_path).unwrap();
let frag: fragments::ConfigFragment = toml::from_str(&content).unwrap();
inputs::ConfigInput::merge_fragments(vec![frag])
}
}

0 comments on commit f507071

Please sign in to comment.