From abaee464936a821568c3fdbd52b9aadd3adb6d0f Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Thu, 11 Feb 2021 00:52:25 -0300 Subject: Partially implement VM The following are now implemented: - [x] Arrow - [x] StringKey - [x] RegexKey - [ ] KeySubtree - [ ] ValueSubtree - [x] Ident - [ ] Param - [x] ApplyPredicate - [x] End --- tests/common/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/common/mod.rs') 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, + } + } } -- cgit 1.4.1