From 11b49c2cc84695e966e9d9a0b05781853b28d7a8 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Thu, 25 Jan 2018 12:00:09 -0800 Subject: [PATCH] feat(uri): Add a `PartialEq` impl for `Uri` --- src/uri.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/uri.rs b/src/uri.rs index ea2ea8dea3..36c170c8fc 100644 --- a/src/uri.rs +++ b/src/uri.rs @@ -274,6 +274,13 @@ impl PartialEq for Uri { } } +impl PartialEq 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