aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/partial_non_lazy_continuation.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-25 17:42:20 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-25 17:42:20 +0200
commit5ee6edf222658e73ee97871972b6fbeef444451b (patch)
treec9233c7a8584a2d027ef1b7443e3e5b59918ca2b /src/construct/partial_non_lazy_continuation.rs
parent91dc4b1f461fa76df7163f68b2a6db361a71beea (diff)
downloadmarkdown-rs-5ee6edf222658e73ee97871972b6fbeef444451b.tar.gz
markdown-rs-5ee6edf222658e73ee97871972b6fbeef444451b.tar.bz2
markdown-rs-5ee6edf222658e73ee97871972b6fbeef444451b.zip
Refactor to not pass codes around
Diffstat (limited to 'src/construct/partial_non_lazy_continuation.rs')
-rw-r--r--src/construct/partial_non_lazy_continuation.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/construct/partial_non_lazy_continuation.rs b/src/construct/partial_non_lazy_continuation.rs
index 5835848..bdc22e4 100644
--- a/src/construct/partial_non_lazy_continuation.rs
+++ b/src/construct/partial_non_lazy_continuation.rs
@@ -20,11 +20,11 @@ use crate::tokenizer::{Code, State, Tokenizer};
/// ^
/// | b
/// ```
-pub fn start(tokenizer: &mut Tokenizer, code: Code) -> State {
- match code {
+pub fn start(tokenizer: &mut Tokenizer) -> State {
+ match tokenizer.current {
Code::CarriageReturnLineFeed | Code::Char('\n' | '\r') => {
tokenizer.enter(Token::LineEnding);
- tokenizer.consume(code);
+ tokenizer.consume();
tokenizer.exit(Token::LineEnding);
State::Fn(Box::new(after))
}
@@ -39,7 +39,7 @@ pub fn start(tokenizer: &mut Tokenizer, code: Code) -> State {
/// > | b
/// ^
/// ```
-fn after(tokenizer: &mut Tokenizer, _code: Code) -> State {
+fn after(tokenizer: &mut Tokenizer) -> State {
if tokenizer.lazy {
State::Nok
} else {