chore: move to crates folder
This commit is contained in:
1 parent
5d10c0d8a8
commit
cb3660bcd2
3393 files changed
+1270
-741
No files matched your search
@@ -0,0 +1,21 @@
|
||||
use std::fs;
|
||||
|
||||
use proc_macro2::TokenStream;
|
||||
use quote::quote;
|
||||
|
||||
use crate::array_to_tokenstream;
|
||||
|
||||
/// Generates the `TokenStream` for the `ScoreboardDisplaySlot` enum.
|
||||
pub fn build() -> TokenStream {
|
||||
let sound_categories: Vec<String> = serde_json::from_str(
|
||||
&fs::read_to_string("../assets/scoreboard_display_slot.json").unwrap(),
|
||||
)
|
||||
.expect("Failed to parse scoreboard_display_slot.json");
|
||||
let variants = array_to_tokenstream(&sound_categories);
|
||||
|
||||
quote! {
|
||||
pub enum ScoreboardDisplaySlot {
|
||||
#variants
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user