diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-11 15:23:45 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-11 15:23:45 +0200 |
commit | cf9f0039911597cd5c9bc8e98f61b5df09b02130 (patch) | |
tree | 43fcec13b338fd64b800df1f72c8cec01adc8581 /src/construct/attention.rs | |
parent | d87dc75500a2e73d9521135054b42c18e6eae987 (diff) | |
download | markdown-rs-cf9f0039911597cd5c9bc8e98f61b5df09b02130.tar.gz markdown-rs-cf9f0039911597cd5c9bc8e98f61b5df09b02130.tar.bz2 markdown-rs-cf9f0039911597cd5c9bc8e98f61b5df09b02130.zip |
Remove boxes around resolvers
Diffstat (limited to 'src/construct/attention.rs')
-rw-r--r-- | src/construct/attention.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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![]; |