aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/partial_label.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_label.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 '')
-rw-r--r--src/construct/partial_label.rs12
1 files changed, 5 insertions, 7 deletions
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());