From 8ffed1822bcbc1b6ce6647b840fb03996b0635ea Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 2 Aug 2022 14:27:31 +0200 Subject: Refactor to remove most closures --- src/construct/partial_whitespace.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/construct/partial_whitespace.rs') 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 { - 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; -- cgit