mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-09-28 17:53:28 +00:00
Allow processing for hints and messages in the info file
This commit is contained in:
@@ -16,16 +16,8 @@ struct InfoFile<'a> {
|
||||
|
||||
#[proc_macro]
|
||||
pub fn include_files(_: TokenStream) -> TokenStream {
|
||||
// Remove `\r` on Windows
|
||||
let info_file = String::from_utf8(
|
||||
include_bytes!("../info.toml")
|
||||
.iter()
|
||||
.copied()
|
||||
.filter(|c| *c != b'\r')
|
||||
.collect(),
|
||||
)
|
||||
.expect("Failed to parse `info.toml` as UTF8");
|
||||
let exercises = toml::de::from_str::<InfoFile>(&info_file)
|
||||
let info_file = include_str!("../info.toml");
|
||||
let exercises = toml::de::from_str::<InfoFile>(info_file)
|
||||
.expect("Failed to parse `info.toml`")
|
||||
.exercises;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user