From cf9f0039911597cd5c9bc8e98f61b5df09b02130 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 11 Aug 2022 15:23:45 +0200 Subject: Remove boxes around resolvers --- src/construct/attention.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/construct/attention.rs') diff --git a/src/construct/attention.rs b/src/construct/attention.rs index ac2ef25..6f91370 100644 --- a/src/construct/attention.rs +++ b/src/construct/attention.rs @@ -52,6 +52,7 @@ //! [html-strong]: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-strong-element use crate::event::{Event, Kind, Name, Point}; +use crate::resolve::Name as ResolveName; use crate::state::{Name as StateName, State}; use crate::tokenizer::Tokenizer; use crate::unicode::PUNCTUATION; @@ -141,7 +142,7 @@ pub fn inside(tokenizer: &mut Tokenizer) -> State { } _ => { tokenizer.exit(Name::AttentionSequence); - tokenizer.register_resolver("attention".to_string(), Box::new(resolve_attention)); + tokenizer.register_resolver(ResolveName::Attention); tokenizer.tokenize_state.marker = b'\0'; State::Ok } @@ -150,7 +151,7 @@ pub fn inside(tokenizer: &mut Tokenizer) -> State { /// Resolve attention sequences. #[allow(clippy::too_many_lines)] -fn resolve_attention(tokenizer: &mut Tokenizer) { +pub fn resolve(tokenizer: &mut Tokenizer) { let mut start = 0; let mut balance = 0; let mut sequences = vec![]; -- cgit