aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/html_flow.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-15 12:52:16 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-15 12:52:16 +0200
commitcfa06e07cdf72018595ae447febc5736e73814e9 (patch)
tree459a4418c40302619ee1f270f9655a1cff1d0607 /src/construct/html_flow.rs
parent81025bd1af39a62fe25de8e77b31bd1e907808b7 (diff)
downloadmarkdown-rs-cfa06e07cdf72018595ae447febc5736e73814e9.tar.gz
markdown-rs-cfa06e07cdf72018595ae447febc5736e73814e9.tar.bz2
markdown-rs-cfa06e07cdf72018595ae447febc5736e73814e9.zip
Remove unneeded field
Diffstat (limited to '')
-rw-r--r--src/construct/html_flow.rs30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/construct/html_flow.rs b/src/construct/html_flow.rs
index c749679..429a1e8 100644
--- a/src/construct/html_flow.rs
+++ b/src/construct/html_flow.rs
@@ -195,8 +195,6 @@ struct Info {
index: usize,
/// Current quote, when in a double or single quoted attribute value.
quote: Option<QuoteKind>,
- /// To do.
- concrete: bool,
}
/// Start of HTML (flow), before optional whitespace.
@@ -251,7 +249,6 @@ fn open(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
buffer: vec![],
index: 0,
quote: None,
- concrete: tokenizer.concrete,
};
match code {
@@ -782,12 +779,11 @@ fn continuation(tokenizer: &mut Tokenizer, code: Code, info: Info) -> StateFnRes
{
tokenizer.exit(Token::HtmlFlowData);
tokenizer.check(blank_line_before, |ok| {
- let func = if ok {
- html_continue_after
+ if ok {
+ Box::new(html_continue_after)
} else {
- html_continue_start // continuation_at_line_ending
- };
- Box::new(move |t, c| func(t, c, info))
+ Box::new(move |t, c| html_continue_start(t, c, info))
+ }
})(tokenizer, code)
}
Code::None | Code::CarriageReturnLineFeed | Code::Char('\n' | '\r') => {
@@ -818,23 +814,21 @@ fn continuation_at_line_ending(tokenizer: &mut Tokenizer, code: Code, info: Info
/// ```
fn html_continue_start(tokenizer: &mut Tokenizer, code: Code, info: Info) -> StateFnResult {
tokenizer.check(partial_non_lazy_continuation, |ok| {
- let func = if ok {
- html_continue_start_non_lazy
+ if ok {
+ Box::new(move |t, c| html_continue_start_non_lazy(t, c, info))
} else {
- html_continue_after
- };
- Box::new(move |t, c| func(t, c, info))
+ Box::new(html_continue_after)
+ }
})(tokenizer, code)
}
/// To do.
-#[allow(clippy::needless_pass_by_value)]
-fn html_continue_after(tokenizer: &mut Tokenizer, code: Code, info: Info) -> StateFnResult {
+fn html_continue_after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
tokenizer.exit(Token::HtmlFlow);
// Feel free to interrupt.
tokenizer.interrupt = false;
- // Restore previous `concrete`.
- tokenizer.concrete = info.concrete;
+ // No longer concrete.
+ tokenizer.concrete = false;
(State::Ok, Some(vec![code]))
}
@@ -1015,7 +1009,7 @@ fn continuation_close(tokenizer: &mut Tokenizer, code: Code, info: Info) -> Stat
match code {
Code::None | Code::CarriageReturnLineFeed | Code::Char('\n' | '\r') => {
tokenizer.exit(Token::HtmlFlowData);
- html_continue_after(tokenizer, code, info)
+ html_continue_after(tokenizer, code)
}
_ => {
tokenizer.consume(code);