From 83e3f07adf9ae047bcb2096a9c7a0352ab4ae123 Mon Sep 17 00:00:00 2001 From: John Turner Date: Mon, 27 Oct 2025 01:11:58 -0400 Subject: remove opt function and replace it with method --- src/lib.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index ad5a479..63dd7eb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -184,6 +184,10 @@ pub trait Parser: Sized { fn ignore(self) -> impl Parser { Ignore { parser: self } } + + fn opt(self) -> impl Parser> { + Opt { parser: self } + } } impl Parser for F @@ -686,14 +690,6 @@ where } } -pub fn opt(parser: P) -> impl Parser> -where - I: Input, - P: Parser, -{ - Opt { parser } -} - struct VerifyInput { parser: P, checker: C, -- cgit v1.2.3