Skip to content

Commit

Permalink
Implement FromStr for URI
Browse files Browse the repository at this point in the history
  • Loading branch information
clehner committed Jul 22, 2021
1 parent 7d486bf commit a6fecbd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/vc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,13 @@ impl TryFrom<String> for URI {
}
}

impl FromStr for URI {
type Err = Error;
fn from_str(uri: &str) -> Result<Self, Self::Err> {
URI::try_from(String::from(uri))
}
}

impl From<URI> for String {
fn from(uri: URI) -> String {
let URI::String(string) = uri;
Expand Down

0 comments on commit a6fecbd

Please sign in to comment.