diff --git a/src/re_unicode.rs b/src/re_unicode.rs index 4653ee3430..c56fd73c9f 100644 --- a/src/re_unicode.rs +++ b/src/re_unicode.rs @@ -133,18 +133,6 @@ impl From for Regex { } } -/// Equality comparison is based on the original string. It is possible that -/// different regular expressions have the same matching behavior, but are -/// still compared unequal. For example, `\d+` and `\d\d*` match the same set -/// of strings, but are not considered equal. -impl PartialEq for Regex { - fn eq(&self, other: &Regex) -> bool { - self.as_str() == other.as_str() - } -} - -impl Eq for Regex {} - impl FromStr for Regex { type Err = Error; diff --git a/tests/api_str.rs b/tests/api_str.rs index 266b6455b2..bc14c726f6 100644 --- a/tests/api_str.rs +++ b/tests/api_str.rs @@ -19,9 +19,3 @@ fn empty_match_unicode_captures_iter() { .collect(); assert_eq!(vec![(0, 0), (3, 3), (4, 4), (7, 7), (8, 8)], ms); } - -#[test] -fn eq() { - use regex::Regex; - assert_eq!(regex!(r"[a-z]+"), Regex::new("[a-z]+").unwrap()); -} diff --git a/tests/misc.rs b/tests/misc.rs index 4fba750359..bc89fd4e02 100644 --- a/tests/misc.rs +++ b/tests/misc.rs @@ -8,13 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use regex::Regex; - mat!(prefix_literal_match, r"^abc", r"abc", Some((0, 3))); mat!(prefix_literal_nomatch, r"^abc", r"zabc", None); mat!(one_literal_edge, r"abc", r"xxxxxab", None); - -#[test] -fn eq() { - assert_eq!(regex!(r"[a-z]+"), Regex::new("[a-z]+").unwrap()); -}