Skip to content

Commit

Permalink
Modified expand_dir() to avoid implicit const promotion (fixes #99)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan committed Jun 17, 2024
1 parent 2ff8cca commit 20f9475
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ fn expand_dir(root: &Path, path: &Path) -> proc_macro2::TokenStream {
let path = normalize_path(root, path);

quote! {
include_dir::Dir::new(#path, &[ #(#child_tokens),* ])
include_dir::Dir::new(#path, {
const ENTRIES: &'static [include_dir::DirEntry<'static>] = &[ #(#child_tokens),*];
ENTRIES
})
}
}

Expand Down

0 comments on commit 20f9475

Please sign in to comment.