summary refs log tree commit diff stats
path: root/tests/common
diff options
context:
space:
mode:
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index 9680504..d0b9e89 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -176,4 +176,14 @@ impl PatternTypes for Value {
     ) -> bool {
         left == right
     }
+
+    fn as_str<'b>(
+        item: RefOwn<'b, Self, Dummy>
+    ) -> Option<&'b str> {
+        match item {
+            RefOwn::Str(key) => Some(key),
+            RefOwn::Ref(Value::S(key)) => Some(key),
+            _ => None,
+        }
+    }
 }