From 6ebaf4fe5ca11a110687b5566ddd5f6a3281514a Mon Sep 17 00:00:00 2001 From: Nathaniel Ringo Date: Thu, 1 Jun 2017 10:23:05 -0500 Subject: [PATCH] Adds PartialEq impl for Regex. --- src/re_unicode.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/re_unicode.rs b/src/re_unicode.rs index d952461d51..cfae24e464 100644 --- a/src/re_unicode.rs +++ b/src/re_unicode.rs @@ -181,6 +181,12 @@ impl FromStr for Regex { } } +impl PartialEq for Regex { + fn eq(&self, other: &Regex) -> bool { + self.as_str() == other.as_str() + } +} + /// Core regular expression methods. impl Regex { /// Compiles a regular expression. Once compiled, it can be used repeatedly