summary refs log tree commit diff stats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2021-02-07 22:19:21 -0300
committerSoniEx2 <endermoneymod@gmail.com>2021-02-07 22:20:34 -0300
commit69652efe8ad9738a94fef571c8b81e342f96e7b4 (patch)
tree9b02efcb139894ac3b5df2667be313f2a9df4319 /src/lib.rs
parentd81ce99e0d1f1371ba9165a67280a810ee27bf82 (diff)
Finish porting parser
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 13 insertions, 1 deletions
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 <https://www.gnu.org/licenses/>.
  */
+#![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<Box<dyn Iterator<Item=KVPair<'b, Self>> + '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<Option<KVPair<'b, Self>>> {
         // 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<T> = dyn (Fn(RefOwn<<T as PatternTypes>::Ref, <T as PatternTypes>::Own>) -> bool) + Send + Sync;
+pub type Predicate<T> = dyn (Fn(RefOwn<'_, <T as PatternTypes>::Ref, <T as PatternTypes>::Own>) -> bool) + Send + Sync;