Skip to content

Commit 9ba9878

Browse files
committed
upgrade toml dependency
1 parent b8556b2 commit 9ba9878

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- New method `LogStorage::set_max_line_length` to limit the logged line length when capturing
1111
builds logs
1212

13+
### Changed
14+
15+
- updated `toml` dependency to 0.8.
16+
1317
## [0.16.0] - 2023-05-02
1418

1519
### Added

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ flate2 = "1"
3333
tar = "0.4.0"
3434
percent-encoding = "2.1.0"
3535
walkdir = "2.2"
36-
toml = "0.5"
36+
toml = "0.8.12"
3737
fs2 = "0.4.3"
3838
remove_dir_all = "0.7"
3939
base64 = "0.13.0"

src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
//! [crater]: https://github.com/rust-lang/crater
2121
//! [docsrs]: https://github.com/rust-lang/docs.rs
2222
23-
#[cfg(test)]
24-
#[macro_use]
25-
extern crate toml;
26-
2723
mod build;
2824
pub mod cmd;
2925
mod crates;

src/prepare.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ impl<'a> TomlTweaker<'a> {
355355

356356
pub fn save(self, output_file: &Path) -> Result<(), Error> {
357357
let crate_name = self.krate.to_string();
358-
::std::fs::write(output_file, Value::Table(self.table).to_string().as_bytes())?;
358+
::std::fs::write(output_file, toml::to_string(&self.table)?.as_bytes())?;
359359
info!(
360360
"tweaked toml for {} written to {}",
361361
crate_name,
@@ -393,7 +393,7 @@ mod tests {
393393
use super::TomlTweaker;
394394
use crate::build::{CratePatch, GitCratePatch, PathCratePatch};
395395
use crate::crates::Crate;
396-
use toml::{self, Value};
396+
use toml::toml;
397397

398398
#[test]
399399
fn test_tweak_table_noop() {
@@ -409,11 +409,10 @@ mod tests {
409409

410410
let krate = Crate::local("/dev/null".as_ref());
411411
let patches: Vec<CratePatch> = Vec::new();
412-
let mut tweaker =
413-
TomlTweaker::new_with_table(&krate, toml.as_table().unwrap().clone(), &patches);
412+
let mut tweaker = TomlTweaker::new_with_table(&krate, toml, &patches);
414413
tweaker.tweak();
415414

416-
assert_eq!(Value::Table(tweaker.table), result);
415+
assert_eq!(tweaker.table, result);
417416
}
418417

419418
#[test]
@@ -445,11 +444,10 @@ mod tests {
445444

446445
let krate = Crate::local("/dev/null".as_ref());
447446
let patches: Vec<CratePatch> = Vec::new();
448-
let mut tweaker =
449-
TomlTweaker::new_with_table(&krate, toml.as_table().unwrap().clone(), &patches);
447+
let mut tweaker = TomlTweaker::new_with_table(&krate, toml, &patches);
450448
tweaker.tweak();
451449

452-
assert_eq!(Value::Table(tweaker.table), result);
450+
assert_eq!(tweaker.table, result);
453451
}
454452

455453
#[test]
@@ -504,10 +502,9 @@ mod tests {
504502
path: "/path/to/baz".into(),
505503
}),
506504
];
507-
let mut tweaker =
508-
TomlTweaker::new_with_table(&krate, toml.as_table().unwrap().clone(), &patches);
505+
let mut tweaker = TomlTweaker::new_with_table(&krate, toml, &patches);
509506
tweaker.tweak();
510507

511-
assert_eq!(Value::Table(tweaker.table), result);
508+
assert_eq!(tweaker.table, result);
512509
}
513510
}

0 commit comments

Comments
 (0)