Implement 'From<Cow<str>>' for 'Uri'.

This commit is contained in:
Sergio Benitez 2017-09-15 03:22:59 -07:00
parent 23093a33b8
commit cced491ec9

View File

@ -312,6 +312,13 @@ impl<'a> From<&'a str> for Uri<'a> {
} }
} }
impl<'a> From<Cow<'a, str>> for Uri<'a> {
#[inline(always)]
fn from(uri: Cow<'a, str>) -> Uri<'a> {
Uri::new(uri)
}
}
impl From<String> for Uri<'static> { impl From<String> for Uri<'static> {
#[inline(always)] #[inline(always)]
fn from(uri: String) -> Uri<'static> { fn from(uri: String) -> Uri<'static> {