Skip to content

Instantly share code, notes, and snippets.

Artem ArtemGr

  • Bizlink
Block or report user

Report or block ArtemGr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View parser_combinators.rs
#![feature(conservative_impl_trait)]
fn take<'a>(take: &'a str) -> impl Fn(&'a str) -> (&'a str, &'a str) {
move |input| {
let len = input.chars().zip(take.chars()).take_while(|&(i, t)| i == t).count();
(&input[0..len], &input[len..])
}
}
fn chain<'a, F1, F2>(first: F1, second: F2) -> impl Fn(&'a str) -> ((&'a str, &'a str), &'a str)
You can’t perform that action at this time.