mirror of
https://git.aramjonghu.dev/AramJonghu/rustlings.git
synced 2026-09-02 16:33:30 +02:00
Move info.toml to rustlings-macros/
This improves the experience for contributors on Windows becuase Windows can't deal with git symbolic links out of the box…
This commit is contained in:
+2
-1
@@ -70,6 +70,7 @@ impl ExerciseDir {
|
||||
}
|
||||
|
||||
pub struct EmbeddedFiles {
|
||||
pub info_file: &'static str,
|
||||
exercise_files: &'static [ExerciseFiles],
|
||||
exercise_dirs: &'static [ExerciseDir],
|
||||
}
|
||||
@@ -148,7 +149,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn dirs() {
|
||||
let exercises = toml_edit::de::from_str::<InfoFile>(include_str!("../info.toml"))
|
||||
let exercises = toml_edit::de::from_str::<InfoFile>(EMBEDDED_FILES.info_file)
|
||||
.expect("Failed to parse `info.toml`")
|
||||
.exercises;
|
||||
|
||||
|
||||
+3
-1
@@ -2,6 +2,8 @@ use anyhow::{bail, Context, Error, Result};
|
||||
use serde::Deserialize;
|
||||
use std::{fs, io::ErrorKind};
|
||||
|
||||
use crate::embedded::EMBEDDED_FILES;
|
||||
|
||||
// Deserialized from the `info.toml` file.
|
||||
#[derive(Deserialize)]
|
||||
pub struct ExerciseInfo {
|
||||
@@ -47,7 +49,7 @@ impl InfoFile {
|
||||
.context("Failed to parse the `info.toml` file")?,
|
||||
Err(e) => {
|
||||
if e.kind() == ErrorKind::NotFound {
|
||||
return toml_edit::de::from_str(include_str!("../info.toml"))
|
||||
return toml_edit::de::from_str(EMBEDDED_FILES.info_file)
|
||||
.context("Failed to parse the embedded `info.toml` file");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user