-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The mime-guess
feature doesn't work
#209
Comments
Hmm... we do have test cases that test this feature out though. |
I'm confused too, it works in my app (https://github.com/BBaoVanC/bobashare, in bobashare-web/src/static_routes.rs), but I don't see Metadata::mimetype listed at all in the rustdoc (although maybe it can't tell it exists), and this simple code fails: use rust_embed::RustEmbed;
#[derive(RustEmbed)]
#[folder = "static/"]
struct Asset;
fn main() {
Asset::get("abc").map(|f| f.metadata.mimetype());
} Not sure what is going on and how it's working fine for me |
@pyrossh I find that if I add this dependency, it works.
|
@vicanso thanks, that was it. The mime-guess feature didn't include the utils crate feature hence the issue. https://github.com/pyrossh/rust-embed/blob/master/Cargo.toml#L87. I've added it now and released v6.6.1 and it works. Here is a simple example, use rust_embed::RustEmbed;
#[derive(RustEmbed)]
#[folder = "static/"]
struct Asset;
fn main() {
println!("{:?}", Asset::get("main.js").unwrap().metadata.mimetype())
} |
When I enable the
mime-guess
feature like this:I can't get the mimetype from metadata, and the build error is:
The text was updated successfully, but these errors were encountered: