diff options
Diffstat (limited to 'tests/common/mod.rs')
-rw-r--r-- | tests/common/mod.rs | 10 |
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, + } + } } |