Skip to content

Commit 1716bc9

Browse files
authored
Merge pull request #179 from Fishrock123/mime-from-str
Mime: add From<&str>
2 parents c310167 + 68c1866 commit 1716bc9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/mime/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ impl FromStr for Mime {
152152
}
153153
}
154154

155+
impl<'a> From<&'a str> for Mime {
156+
fn from(value: &'a str) -> Self {
157+
Self::from_str(value).unwrap()
158+
}
159+
}
160+
155161
impl ToHeaderValues for Mime {
156162
type Iter = option::IntoIter<HeaderValue>;
157163

0 commit comments

Comments
 (0)