Add From/Into for url/xsdanyuri

This commit is contained in:
asonix 2020-03-10 10:48:26 -05:00
parent 3239b7daa7
commit 83d512d20b

View file

@ -5,6 +5,18 @@ pub struct XsdAnyUri(url::Url);
#[error("Could not parse XsdAnyUri")]
pub struct XsdAnyUriError;
impl From<url::Url> for XsdAnyUri {
fn from(u: url::Url) -> Self {
XsdAnyUri(u)
}
}
impl From<XsdAnyUri> for url::Url {
fn from(u: XsdAnyUri) -> Self {
u.0
}
}
impl Default for XsdAnyUri {
fn default() -> Self {
"data:text/plain,uwu".parse().unwrap()