~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.


6afa7480 BBaoVanC

2 years ago
Don't need to run mimetype through quote!
Files changed (1) hide show
  1. impl/src/lib.rs +1 -4
impl/src/lib.rs CHANGED
@@ -175,10 +175,7 @@ fn embed_file(rel_path: &str, full_canonical_path: &str) -> TokenStream2 {
175
175
  None => quote! { None },
176
176
  };
177
177
  #[cfg(feature = "mime-guess")]
178
- let mimetype = {
179
- let mt = file.metadata.mimetype();
178
+ let mimetype = file.metadata.mimetype();
180
- quote! { #mt }
181
- };
182
179
  #[cfg(not(feature = "mime-guess"))]
183
180
  let mimetype = quote! { None };
184
181