From 691ddae5915b1ad782ab1eb4c8d0201660119933 Mon Sep 17 00:00:00 2001 From: "tien.xuan.vo" Date: Fri, 6 Sep 2024 11:15:59 +0700 Subject: [PATCH] fix: Fix can't compare 2 eachKey matching rules, 2 eachValue matching rules --- rust/pact_models/src/matchingrules/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/pact_models/src/matchingrules/mod.rs b/rust/pact_models/src/matchingrules/mod.rs index 606766df..81b03d68 100644 --- a/rust/pact_models/src/matchingrules/mod.rs +++ b/rust/pact_models/src/matchingrules/mod.rs @@ -537,6 +537,8 @@ impl PartialEq for MatchingRule { (MatchingRule::Include(str1), MatchingRule::Include(str2)) => str1 == str2, (MatchingRule::ContentType(str1), MatchingRule::ContentType(str2)) => str1 == str2, (MatchingRule::ArrayContains(variants1), MatchingRule::ArrayContains(variants2)) => variants1 == variants2, + (MatchingRule::EachKey(definition1), MatchingRule::EachKey(definition2)) => definition1 == definition2, + (MatchingRule::EachValue(definition1), MatchingRule::EachValue(definition2)) => definition1 == definition2, _ => mem::discriminant(self) == mem::discriminant(other) } }