From 8f8d72a749a39845fd03ae259533abe73dc7dcdf Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 9 Aug 2022 14:04:27 +0200 Subject: Add support for passing `ok`, `nok` as separate states to attempts --- src/construct/partial_title.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/construct/partial_title.rs') diff --git a/src/construct/partial_title.rs b/src/construct/partial_title.rs index 8b72608..1d3e9b2 100644 --- a/src/construct/partial_title.rs +++ b/src/construct/partial_title.rs @@ -106,13 +106,11 @@ pub fn at_break(tokenizer: &mut Tokenizer) -> State { }, ); - tokenizer.attempt(state_name, |ok| { - State::Fn(if ok { - StateName::TitleAfterEol - } else { - StateName::TitleAtBlankLine - }) - }) + tokenizer.attempt( + state_name, + State::Fn(StateName::TitleAfterEol), + State::Fn(StateName::TitleAtBlankLine), + ) } Some(b'"' | b'\'' | b')') if tokenizer.current.unwrap() == tokenizer.tokenize_state.marker => -- cgit