From f4b3c4cd2537ac983068d97270aafae7005c01a2 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sun, 28 Feb 2021 23:57:40 -0300 Subject: Clean up API --- src/lib.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 005e9bf..3cb2198 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -127,6 +127,8 @@ mod vm; pub use pattern::Pattern; +pub use vm::Matcher; + // TODO replace with GATs /// A borrowed or owned value of various types. /// @@ -199,24 +201,14 @@ pub trait PatternTypes { /// None if this operation is unsupported for the given value. fn pairs<'b>( item: RefOwn<'b, Self::Ref, Self::Own> - ) -> Option> + 'b>> { - // TODO remove these default impls that only exist for testing purposes - let _ = item; - let x = None; - Some(Box::new(x.into_iter())) - } + ) -> Option> + 'b>>; /// Returns an optional key-value pair keyed by the given key, or None if /// this operation is unsupported for the given value. fn get<'a, 'b>( item: RefOwn<'b, Self::Ref, Self::Own>, key: RefOwn<'a, Self::Ref, Self::Own> - ) -> Option>> { - // TODO remove these default impls that only exist for testing purposes - let _ = item; - let _ = key; - Some(None) - } + ) -> Option>>; // TODO replace with GATs + newtypes /// Returns whether two keys/values are the same/equivalent. This must provide -- cgit 1.4.1