Skip to content

Commit 02e29e4

Browse files
chancedanonrig
authored andcommitted
implements std::str::FromStr for Url
1 parent e10460c commit 02e29e4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,14 @@ impl std::fmt::Display for Url {
473473
}
474474
}
475475

476+
impl std::str::FromStr for Url {
477+
type Err = Error;
478+
479+
fn from_str(s: &str) -> Result<Self, Self::Err> {
480+
Self::parse(s, None)
481+
}
482+
}
483+
476484
#[cfg(test)]
477485
mod test {
478486
use super::*;

0 commit comments

Comments
 (0)