Skip to content

Commit

Permalink
Merge pull request #214 from Chtau/const_upper_snake_case
Browse files Browse the repository at this point in the history
Change const to upper case
  • Loading branch information
Peter John committed Jul 29, 2023
2 parents a1f5565 + 2f87784 commit 1623d29
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ fn dynamic(ident: &syn::Ident, folder_path: String, prefix: Option<&str>, includ
};

let declare_includes = quote! {
const includes: &[&str] = &[#(#includes),*];
const INCLUDES: &[&str] = &[#(#includes),*];
};

let declare_excludes = quote! {
const excludes: &[&str] = &[#(#excludes),*];
const EXCLUDES: &[&str] = &[#(#excludes),*];
};

let canonical_folder_path = Path::new(&folder_path).canonicalize().expect("folder path must resolve to an absolute path");
Expand All @@ -127,7 +127,7 @@ fn dynamic(ident: &syn::Ident, folder_path: String, prefix: Option<&str>, includ
return None;
}

if rust_embed::utils::is_path_included(&rel_file_path, includes, excludes) {
if rust_embed::utils::is_path_included(&rel_file_path, INCLUDES, EXCLUDES) {
rust_embed::utils::read_file_from_fs(&canonical_file_path).ok()
} else {
None
Expand All @@ -141,7 +141,7 @@ fn dynamic(ident: &syn::Ident, folder_path: String, prefix: Option<&str>, includ
#declare_includes
#declare_excludes

rust_embed::utils::get_files(String::from(#folder_path), includes, excludes)
rust_embed::utils::get_files(String::from(#folder_path), INCLUDES, EXCLUDES)
.map(|e| #map_iter)
}
}
Expand Down

0 comments on commit 1623d29

Please sign in to comment.