summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-04-07 23:57:54 +0200
committermo8it <mo8it@proton.me>2024-04-07 23:57:54 +0200
commit394ca402a8883581dc040546b4ca18b07d76a7f2 (patch)
treebc2725f234fc73d740c0b5179a198589b1cd27a5
parentdb25cc91576a05b02edd3754df85eb5668cec83f (diff)
Remove the info_toml_content field
-rw-r--r--rustlings-macros/src/lib.rs1
-rw-r--r--src/embedded.rs1
-rw-r--r--src/exercise.rs2
3 files changed, 1 insertions, 3 deletions
diff --git a/rustlings-macros/src/lib.rs b/rustlings-macros/src/lib.rs
index 598b5c3..d8da666 100644
--- a/rustlings-macros/src/lib.rs
+++ b/rustlings-macros/src/lib.rs
@@ -75,7 +75,6 @@ pub fn include_files(_: TokenStream) -> TokenStream {
quote! {
EmbeddedFiles {
- info_toml_content: ::std::include_str!("../info.toml"),
exercises_dir: ExercisesDir {
readme: EmbeddedFile {
path: "exercises/README.md",
diff --git a/src/embedded.rs b/src/embedded.rs
index 56b4b61..1e2d677 100644
--- a/src/embedded.rs
+++ b/src/embedded.rs
@@ -65,7 +65,6 @@ struct ExercisesDir {
}
pub struct EmbeddedFiles {
- pub info_toml_content: &'static str,
exercises_dir: ExercisesDir,
}
diff --git a/src/exercise.rs b/src/exercise.rs
index ae47d5e..c9fb331 100644
--- a/src/exercise.rs
+++ b/src/exercise.rs
@@ -52,7 +52,7 @@ impl InfoFile {
if let Ok(file_content) = fs::read_to_string("info.toml") {
toml_edit::de::from_str(&file_content)
} else {
- toml_edit::de::from_str(EMBEDDED_FILES.info_toml_content)
+ toml_edit::de::from_str(include_str!("../info.toml"))
}
.context("Failed to parse `info.toml`")
}