1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2025-07-03 00:46:57 +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:
mo8it
2024-05-13 01:25:38 +02:00
parent d9df809838
commit 11fda5d70f
7 changed files with 1295 additions and 1292 deletions

View File

@ -15,7 +15,8 @@ struct InfoFile {
#[proc_macro]
pub fn include_files(_: TokenStream) -> TokenStream {
let exercises = toml_edit::de::from_str::<InfoFile>(include_str!("../info.toml"))
let info_file = include_str!("../info.toml");
let exercises = toml_edit::de::from_str::<InfoFile>(info_file)
.expect("Failed to parse `info.toml`")
.exercises;
@ -46,6 +47,7 @@ pub fn include_files(_: TokenStream) -> TokenStream {
quote! {
EmbeddedFiles {
info_file: #info_file,
exercise_files: &[#(ExerciseFiles { exercise: include_bytes!(#exercise_files), solution: include_bytes!(#solution_files), dir_ind: #dir_inds }),*],
exercise_dirs: &[#(ExerciseDir { name: #dirs, readme: include_bytes!(#readmes) }),*]
}