http-rs / http-rs/tide

tide::Response::set_content_type usage

Open
#575 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
5.1k
Forks
329
PR merge metrics
No merged PRs in 30d

Description

This function takes `impl Into` as an input which is not so great from usability stand-point.
Because `Mime` doesn't implement `From` for anything but itself.

On the other hand `Mime` implements `FromStr` which allows using it like this. `"text/html".parse()`.
But it context of `set_content_type` call rustc cannot infer what type to parse to. It could if `set_content_type` would accept `Mime` type directly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.