Skip to content

tide::Response::set_content_type usage #575

@zakarumych

Description

@zakarumych

This function takes impl Into<Mime> 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions