summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-03-25 02:35:51 +0100
committermo8it <mo8it@proton.me>2024-03-25 02:35:51 +0100
commit83cd91ccca22e36ed94e03cc622a88ef45e6da10 (patch)
tree9783911c400da9d329628e6954be89ac832f4293
parent9c6f56b836e91da9071830d4dd4a64417fdced9d (diff)
Replace toml with toml_edit
-rw-r--r--Cargo.lock18
-rw-r--r--Cargo.toml2
-rw-r--r--src/main.rs6
3 files changed, 8 insertions, 18 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 3950c47..52b2725 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -536,7 +536,7 @@ dependencies = [
"regex",
"serde",
"serde_json",
- "toml",
+ "toml_edit",
]
[[package]]
@@ -618,18 +618,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76"
[[package]]
-name = "toml"
-version = "0.8.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290"
-dependencies = [
- "serde",
- "serde_spanned",
- "toml_datetime",
- "toml_edit",
-]
-
-[[package]]
name = "toml_datetime"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -640,9 +628,9 @@ dependencies = [
[[package]]
name = "toml_edit"
-version = "0.22.6"
+version = "0.22.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6"
+checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4"
dependencies = [
"indexmap",
"serde",
diff --git a/Cargo.toml b/Cargo.toml
index 218b799..2861459 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ notify-debouncer-mini = "0.4.1"
regex = "1.10.3"
serde_json = "1.0.114"
serde = { version = "1.0.197", features = ["derive"] }
-toml = "0.8.10"
+toml_edit = { version = "0.22.9", default-features = false, features = ["parse", "serde"] }
[[bin]]
name = "rustlings"
diff --git a/src/main.rs b/src/main.rs
index a06f0c5..8e0029d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -107,8 +107,10 @@ fn main() {
std::process::exit(1);
}
- let toml_str = &fs::read_to_string("info.toml").unwrap();
- let exercises = toml::from_str::<ExerciseList>(toml_str).unwrap().exercises;
+ let info_file = fs::read_to_string("info.toml").unwrap();
+ let exercises = toml_edit::de::from_str::<ExerciseList>(&info_file)
+ .unwrap()
+ .exercises;
let verbose = args.nocapture;
let command = args.command.unwrap_or_else(|| {