From 0d9c4611922535533746d1a86f10ef4e701c950e Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 11 Aug 2022 17:26:17 +0200 Subject: Refactor attempts to remove unneeded state name --- src/construct/partial_title.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/construct/partial_title.rs') diff --git a/src/construct/partial_title.rs b/src/construct/partial_title.rs index 6421360..6f7a037 100644 --- a/src/construct/partial_title.rs +++ b/src/construct/partial_title.rs @@ -99,19 +99,17 @@ pub fn at_break(tokenizer: &mut Tokenizer) -> State { State::Nok } Some(b'\n') => { - let name = space_or_tab_eol_with_options( + tokenizer.attempt( + State::Next(StateName::TitleAfterEol), + State::Next(StateName::TitleAtBlankLine), + ); + State::Retry(space_or_tab_eol_with_options( tokenizer, Options { content_type: Some(Content::String), connect: tokenizer.tokenize_state.connect, }, - ); - - tokenizer.attempt( - name, - State::Next(StateName::TitleAfterEol), - State::Next(StateName::TitleAtBlankLine), - ) + )) } Some(b'"' | b'\'' | b')') if tokenizer.current.unwrap() == tokenizer.tokenize_state.marker => -- cgit