Introduce unstable, incomplete WASM support

This commit is contained in:
Sean McArthur
2019-09-24 14:50:30 -07:00
parent 6413a4349e
commit 932defd879
10 changed files with 543 additions and 78 deletions

View File

@@ -37,14 +37,16 @@ impl<'a> PolyfillTryInto for &'a String {
}
}
pub(crate) fn expect_uri(url: &Url) -> hyper::Uri {
url.as_str()
.parse()
.expect("a parsed Url should always be a valid Uri")
}
if_hyper! {
pub(crate) fn expect_uri(url: &Url) -> http::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()
pub(crate) fn try_uri(url: &Url) -> Option<http::Uri> {
url.as_str().parse().ok()
}
}
#[cfg(test)]