diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-22 15:03:15 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-22 15:03:15 +0200 |
commit | 41fc406af206e21014eaaba94bcf6b1854f892b3 (patch) | |
tree | 510f6e1d763643da9072f9cf7e097e777fdbd5b8 /src/construct/block_quote.rs | |
parent | 37fad739ba73d488d4c3652caee01f1ec5d0aaaa (diff) | |
download | markdown-rs-41fc406af206e21014eaaba94bcf6b1854f892b3.tar.gz markdown-rs-41fc406af206e21014eaaba94bcf6b1854f892b3.tar.bz2 markdown-rs-41fc406af206e21014eaaba94bcf6b1854f892b3.zip |
Refactor to pass ints instead of vecs around
Diffstat (limited to 'src/construct/block_quote.rs')
-rw-r--r-- | src/construct/block_quote.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/construct/block_quote.rs b/src/construct/block_quote.rs index a8a8fa8..d1b4005 100644 --- a/src/construct/block_quote.rs +++ b/src/construct/block_quote.rs @@ -53,7 +53,7 @@ pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { if tokenizer.parse_state.constructs.block_quote { tokenizer.go(space_or_tab_min_max(0, max), before)(tokenizer, code) } else { - (State::Nok, None) + (State::Nok, 0) } } @@ -103,9 +103,9 @@ fn cont_before(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { tokenizer.enter(Token::BlockQuoteMarker); tokenizer.consume(code); tokenizer.exit(Token::BlockQuoteMarker); - (State::Fn(Box::new(cont_after)), None) + (State::Fn(Box::new(cont_after)), 0) } - _ => (State::Nok, None), + _ => (State::Nok, 0), } } @@ -124,11 +124,11 @@ fn cont_after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { tokenizer.consume(code); tokenizer.exit(Token::SpaceOrTab); tokenizer.exit(Token::BlockQuotePrefix); - (State::Ok, None) + (State::Ok, 0) } _ => { tokenizer.exit(Token::BlockQuotePrefix); - (State::Ok, Some(vec![code])) + (State::Ok, if matches!(code, Code::None) { 0 } else { 1 }) } } } |