Skip to content

Commit 83cd91c

Browse files
committed
Replace toml with toml_edit
1 parent 9c6f56b commit 83cd91c

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

Cargo.lock

Lines changed: 3 additions & 15 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
@@ -18,7 +18,7 @@ notify-debouncer-mini = "0.4.1"
1818
regex = "1.10.3"
1919
serde_json = "1.0.114"
2020
serde = { version = "1.0.197", features = ["derive"] }
21-
toml = "0.8.10"
21+
toml_edit = { version = "0.22.9", default-features = false, features = ["parse", "serde"] }
2222

2323
[[bin]]
2424
name = "rustlings"

src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ fn main() {
107107
std::process::exit(1);
108108
}
109109

110-
let toml_str = &fs::read_to_string("info.toml").unwrap();
111-
let exercises = toml::from_str::<ExerciseList>(toml_str).unwrap().exercises;
110+
let info_file = fs::read_to_string("info.toml").unwrap();
111+
let exercises = toml_edit::de::from_str::<ExerciseList>(&info_file)
112+
.unwrap()
113+
.exercises;
112114
let verbose = args.nocapture;
113115

114116
let command = args.command.unwrap_or_else(|| {

0 commit comments

Comments
 (0)