From 69652efe8ad9738a94fef571c8b81e342f96e7b4 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sun, 7 Feb 2021 22:19:21 -0300 Subject: Finish porting parser --- src/lib.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 0e14d97..2407115 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,6 +15,14 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ +#![warn(rust_2018_idioms)] +#![cfg_attr(not(feature = "stable"), feature(label_break_value))] + +extern crate boolinator; +extern crate regex; + +#[cfg(test)] +extern crate proptest; pub mod errors; mod parser; @@ -25,6 +33,7 @@ pub use pattern::Pattern; // TODO replace with GATs /// A borrowed or owned value of various types. +#[derive(Debug)] pub enum RefOwn<'b, T: ?Sized, U> { /// Borrowed T. Ref(&'b T), @@ -93,6 +102,7 @@ pub trait PatternTypes { 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())) } @@ -104,6 +114,8 @@ pub trait PatternTypes { 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) } @@ -118,4 +130,4 @@ pub trait PatternTypes { } // TODO -type Predicate = dyn (Fn(RefOwn<::Ref, ::Own>) -> bool) + Send + Sync; +pub type Predicate = dyn (Fn(RefOwn<'_, ::Ref, ::Own>) -> bool) + Send + Sync; -- cgit 1.4.1