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_label.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/construct/partial_label.rs') diff --git a/src/construct/partial_label.rs b/src/construct/partial_label.rs index 0c8366e..070bdc0 100644 --- a/src/construct/partial_label.rs +++ b/src/construct/partial_label.rs @@ -109,13 +109,11 @@ pub fn at_break(tokenizer: &mut Tokenizer) -> State { connect: tokenizer.tokenize_state.connect, }, ); - tokenizer.attempt(state_name, |ok| { - State::Fn(if ok { - StateName::LabelEolAfter - } else { - StateName::LabelAtBlankLine - }) - }) + tokenizer.attempt( + state_name, + State::Fn(StateName::LabelEolAfter), + State::Fn(StateName::LabelAtBlankLine), + ) } Some(b']') => { tokenizer.exit(tokenizer.tokenize_state.token_3.clone()); -- cgit