-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add guess_mime_type_str #38
Conversation
Sorry for taking so long to look at this. I think I prefer the |
It does return Sorry, I misread that. But... |
So.. Right now, the I agree that |
Yeah I didn't put a whole load of thought into the namings of any of these functions. I'll probably redo them in 3.0 along with upgrading to I don't want to add another |
By the way, I don't think it's a good idea to return So we could maybe have |
There's a lot of debate in the comments of the top answer as well as the answer you linked. Those RFCs are specifically about In that case, they should follow the advice of the RFC. In the more general case, however, |
All right; I suppose not everything using MIME is HTTP, so it's fair that providing these helpers might be useful -- although I still think they should be de-emphasised.
I can change this PR to use whatever name you think will be in the next version. |
I still prefer If you like you can add notes about assuming |
This is confusing :-). My function takes a path, not an extension. |
I don't think it's confusing. It's the MIME string for the path's extension. No other part of the path matters. Using "path" in general muddies the interpretation, implies that we might actually load the file to check its structure. Call it |
85aa234
to
bd48c82
Compare
Updated. |
bd48c82
to
604cdb1
Compare
Looks good, thanks. |
...that's similar to
get_mime_type_str
(returnsOption<&'static str>
) and changeguess_mime_type_opt
to use it.