diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-02 14:27:31 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-02 14:27:31 +0200 |
commit | 8ffed1822bcbc1b6ce6647b840fb03996b0635ea (patch) | |
tree | dc01319d360b6e5ec08c893413ff056d3abd43bc /src/construct/partial_whitespace.rs | |
parent | 13cf914b5162fb12c842e983538b42d4b60cdcb8 (diff) | |
download | markdown-rs-8ffed1822bcbc1b6ce6647b840fb03996b0635ea.tar.gz markdown-rs-8ffed1822bcbc1b6ce6647b840fb03996b0635ea.tar.bz2 markdown-rs-8ffed1822bcbc1b6ce6647b840fb03996b0635ea.zip |
Refactor to remove most closures
Diffstat (limited to 'src/construct/partial_whitespace.rs')
-rw-r--r-- | src/construct/partial_whitespace.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/construct/partial_whitespace.rs b/src/construct/partial_whitespace.rs index bf3bd4d..0905e10 100644 --- a/src/construct/partial_whitespace.rs +++ b/src/construct/partial_whitespace.rs @@ -47,17 +47,9 @@ use crate::constant::HARD_BREAK_PREFIX_SIZE_MIN; use crate::token::Token; -use crate::tokenizer::{Event, EventType, Resolver, Tokenizer}; +use crate::tokenizer::{Event, EventType, Tokenizer}; use crate::util::slice::{Position, Slice}; -/// Create a resolver to handle trailing whitespace in events. -/// -/// Performing this as a resolver instead of a tokenizer improves performance -/// *a lot*. -pub fn create_resolve_whitespace(hard_break: bool, trim_whole: bool) -> Box<Resolver> { - Box::new(move |t| resolve_whitespace(t, hard_break, trim_whole)) -} - /// Resolve whitespace. pub fn resolve_whitespace(tokenizer: &mut Tokenizer, hard_break: bool, trim_whole: bool) { let mut index = 0; |