~repos /rust-embed
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.
227c4e09
—
BBaoVanC 2 years ago
Add test to actions and fix it in release mode
- .github/workflows/test.yml +2 -0
- impl/src/lib.rs +1 -1
.github/workflows/test.yml
CHANGED
|
@@ -33,6 +33,8 @@ jobs:
|
|
|
33
33
|
cargo test --test lib
|
|
34
34
|
cargo test --test lib --features "debug-embed"
|
|
35
35
|
cargo test --test lib --features "compression" --release
|
|
36
|
+
cargo test --test mime_guess --features "mime-guess"
|
|
37
|
+
cargo test --test mime_guess --features "mime-guess" --release
|
|
36
38
|
cargo test --test interpolated_path --features "interpolate-folder-path"
|
|
37
39
|
cargo test --test interpolated_path --features "interpolate-folder-path" --release
|
|
38
40
|
cargo build --example basic
|
impl/src/lib.rs
CHANGED
|
@@ -177,7 +177,7 @@ fn embed_file(rel_path: &str, full_canonical_path: &str) -> TokenStream2 {
|
|
|
177
177
|
#[cfg(feature = "mime-guess")]
|
|
178
178
|
let mimetype = {
|
|
179
179
|
let mt = file.metadata.mimetype().to_string();
|
|
180
|
-
quote! {
|
|
180
|
+
quote! { #mt }
|
|
181
181
|
};
|
|
182
182
|
#[cfg(not(feature = "mime-guess"))]
|
|
183
183
|
let mimetype = quote! { None };
|