feat(uri): Add a PartialEq<str> impl for Uri

This commit is contained in:
Steven Fackler
2018-01-25 12:00:09 -08:00
committed by Sean McArthur
parent 5c170e8ccd
commit 11b49c2cc8

View File

@@ -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