@@ -38,10 +38,14 @@ impl<'a> PolyfillTryInto for &'a String {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn to_uri(url: &Url) -> ::hyper::Uri {
|
||||
pub(crate) fn expect_uri(url: &Url) -> ::hyper::Uri {
|
||||
url.as_str().parse().expect("a parsed Url should always be a valid Uri")
|
||||
}
|
||||
|
||||
pub(crate) fn try_uri(url: &Url) -> Option<::hyper::Uri> {
|
||||
url.as_str().parse().ok()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user