~repos /rust-embed

#rust#proc-macro#http

git clone https://pyrossh.dev/repos/rust-embed.git

rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.


4a2a281c Day Fisher

1 year ago
add small comment
Files changed (1) hide show
  1. impl/src/lib.rs +2 -0
impl/src/lib.rs CHANGED
@@ -125,6 +125,8 @@ fn dynamic(ident: &syn::Ident, folder_path: String, prefix: Option<&str>, includ
125
125
  const EXCLUDES: &[&str] = &[#(#excludes),*];
126
126
  };
127
127
 
128
+ // In metadata_only mode, we still need to read file contents to generate the file hash, but
129
+ // then we drop the file data.
128
130
  let strip_contents = metadata_only.then_some(quote! {
129
131
  .map(|mut file| { file.data = ::std::default::Default::default(); file })
130
132
  });