Skip to content

Add some some basic functions to Mime #1047

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

mrobinson
Copy link
Member

This adds Clone, fn new(), and fn matches() to Mime. Servo uses
data_url::Mime in places as it supports charsets and these helpers
make it a lot nicer to use.

This adds `Clone`, `fn new()`, and `fn matches()` to `Mime`. Servo uses
`data_url::Mime` in places as it supports charsets and these helpers
make it a lot nicer to use.
@@ -12,6 +12,20 @@ pub struct Mime {
}

impl Mime {
pub fn new(type_: &str, subtype: &str) -> Self {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A line of docs here? Just mention that this constructs the MIME <type>/<subtype> with no parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants