aboutsummaryrefslogtreecommitdiffstats
path: root/src/content
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-11 15:23:45 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-11 15:23:45 +0200
commitcf9f0039911597cd5c9bc8e98f61b5df09b02130 (patch)
tree43fcec13b338fd64b800df1f72c8cec01adc8581 /src/content
parentd87dc75500a2e73d9521135054b42c18e6eae987 (diff)
downloadmarkdown-rs-cf9f0039911597cd5c9bc8e98f61b5df09b02130.tar.gz
markdown-rs-cf9f0039911597cd5c9bc8e98f61b5df09b02130.tar.bz2
markdown-rs-cf9f0039911597cd5c9bc8e98f61b5df09b02130.zip
Remove boxes around resolvers
Diffstat (limited to '')
-rw-r--r--src/content/document.rs3
-rw-r--r--src/content/string.rs3
-rw-r--r--src/content/text.rs3
3 files changed, 4 insertions, 5 deletions
diff --git a/src/content/document.rs b/src/content/document.rs
index 998bc06..b990ba5 100644
--- a/src/content/document.rs
+++ b/src/content/document.rs
@@ -531,7 +531,4 @@ fn resolve(tokenizer: &mut Tokenizer) {
tokenizer
.resolvers
.append(&mut child.resolvers.split_off(0));
- tokenizer
- .resolver_ids
- .append(&mut child.resolver_ids.split_off(0));
}
diff --git a/src/content/string.rs b/src/content/string.rs
index 79dee6c..ce850e7 100644
--- a/src/content/string.rs
+++ b/src/content/string.rs
@@ -13,6 +13,7 @@
//! [text]: crate::content::text
use crate::construct::partial_whitespace::resolve_whitespace;
+use crate::resolve::Name as ResolveName;
use crate::state::{Name as StateName, State};
use crate::tokenizer::Tokenizer;
@@ -20,7 +21,7 @@ const MARKERS: [u8; 2] = [b'&', b'\\'];
/// Start of string.
pub fn start(tokenizer: &mut Tokenizer) -> State {
- tokenizer.register_resolver("whitespace".to_string(), Box::new(resolve));
+ tokenizer.register_resolver(ResolveName::String);
tokenizer.tokenize_state.markers = &MARKERS;
State::Retry(StateName::StringBefore)
}
diff --git a/src/content/text.rs b/src/content/text.rs
index 77c5963..570759d 100644
--- a/src/content/text.rs
+++ b/src/content/text.rs
@@ -21,6 +21,7 @@
//! > [whitespace][crate::construct::partial_whitespace].
use crate::construct::partial_whitespace::resolve_whitespace;
+use crate::resolve::Name as ResolveName;
use crate::state::{Name as StateName, State};
use crate::tokenizer::Tokenizer;
@@ -38,7 +39,7 @@ const MARKERS: [u8; 9] = [
/// Start of text.
pub fn start(tokenizer: &mut Tokenizer) -> State {
- tokenizer.register_resolver("whitespace".to_string(), Box::new(resolve));
+ tokenizer.register_resolver(ResolveName::Text);
tokenizer.tokenize_state.markers = &MARKERS;
State::Retry(StateName::TextBefore)
}