aboutsummaryrefslogtreecommitdiffstats
path: root/src/tokenizer.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-19 18:19:15 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-19 18:19:15 +0200
commit7ec35068c86a546dac8172e74e8a34e3b6813eb2 (patch)
tree1c709d2f392f9a95bd60ddb0908ab9ed2f2b4242 /src/tokenizer.rs
parent0f20660cb95abd4f407bdafa2c45e01829fa971f (diff)
downloadmarkdown-rs-7ec35068c86a546dac8172e74e8a34e3b6813eb2.tar.gz
markdown-rs-7ec35068c86a546dac8172e74e8a34e3b6813eb2.tar.bz2
markdown-rs-7ec35068c86a546dac8172e74e8a34e3b6813eb2.zip
Remove a couple of clones
Diffstat (limited to '')
-rw-r--r--src/tokenizer.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index 4e184f4..8813bdc 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -203,7 +203,7 @@ pub struct Tokenizer<'a> {
/// List of names associated with attached resolvers.
resolver_ids: Vec<String>,
/// Shared parsing state across tokenizers.
- pub parse_state: &'a ParseState,
+ pub parse_state: &'a ParseState<'a>,
/// Stack of label (start) that could form images and links.
///
/// Used when tokenizing [text content][crate::content::text].
@@ -235,7 +235,7 @@ pub struct Tokenizer<'a> {
impl<'a> Tokenizer<'a> {
/// Create a new tokenizer.
- pub fn new(point: Point, index: usize, parse_state: &'a ParseState) -> Tokenizer {
+ pub fn new(point: Point, index: usize, parse_state: &'a ParseState) -> Tokenizer<'a> {
Tokenizer {
previous: Code::None,
current: Code::None,
@@ -701,7 +701,6 @@ fn feed_impl(
codes: &[Code],
start: impl FnOnce(&mut Tokenizer, Code) -> StateFnResult + 'static,
) -> StateFnResult {
- let codes = codes;
let mut state = State::Fn(Box::new(start));
let mut index = 0;