From 730742639dc96ec06ff4aab73c6767a1042a95d6 Mon Sep 17 00:00:00 2001 From: Andrew Golovashevich Date: Sun, 9 Nov 2025 15:13:13 +0300 Subject: [PATCH] Fix in Predicate trait and build file --- .gitignore | 3 ++- Cargo.toml | 5 +---- src/lib.rs | 15 ++------------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index f419dc7..1dc0060 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /.idea -/target +/target/* +/Cargo.lock \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index d9fc5b4..5b9e848 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,5 @@ [package] -name = "untitled" -version = "0.1.0" +name = "source_stream_0" edition = "2024" -[dependencies] - [lib] \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index ddd803d..11e18c1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ pub trait Predicate { fn check(&mut self, chr: C) -> bool; } -impl Predicate for fn(C) -> bool { +impl bool> Predicate for F { fn check(&mut self, chr: C) -> bool { return self(chr); } @@ -30,15 +30,4 @@ pub trait SourceStream> { fn pos(&mut self) -> P; fn currentChar(&mut self) -> C; -} - -// -// fn sandbox>(ctx: &mut impl SourceStream) { -// let x = "1324"; -// let y = ['a']; -// ctx.collect(|c: &char| -> bool { -// return true; -// }).compareKeyword(&y); -// -// return; -// } +} \ No newline at end of file