Skip to content

Commit

Permalink
feat(uri): Add a PartialEq<str> impl for Uri
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler authored and seanmonstar committed Jan 25, 2018
1 parent 5c170e8 commit 11b49c2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,13 @@ impl PartialEq for Uri {
}
}

impl PartialEq<str> for Uri {
fn eq(&self, other: &str) -> bool {
self.source.as_str() == other
}
}

// FIXME delete for 0.12
impl<'a> PartialEq<&'a str> for Uri {
fn eq(&self, other: & &'a str) -> bool {
self.source.as_str() == *other
Expand Down

0 comments on commit 11b49c2

Please sign in to comment.