aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/partial_title.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-09 14:04:27 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-09 14:04:27 +0200
commit8f8d72a749a39845fd03ae259533abe73dc7dcdf (patch)
treeebc54d404f5a5e7e406f6323131dae1ed7a79c50 /src/construct/partial_title.rs
parentfafcfd55e5f7ea8b87cab4bbf979730d81749402 (diff)
downloadmarkdown-rs-8f8d72a749a39845fd03ae259533abe73dc7dcdf.tar.gz
markdown-rs-8f8d72a749a39845fd03ae259533abe73dc7dcdf.tar.bz2
markdown-rs-8f8d72a749a39845fd03ae259533abe73dc7dcdf.zip
Add support for passing `ok`, `nok` as separate states to attempts
Diffstat (limited to 'src/construct/partial_title.rs')
-rw-r--r--src/construct/partial_title.rs12
1 files changed, 5 insertions, 7 deletions
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 =>