From 7ec35068c86a546dac8172e74e8a34e3b6813eb2 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 19 Jul 2022 18:19:15 +0200 Subject: Remove a couple of clones --- src/tokenizer.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/tokenizer.rs') 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, /// 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; -- cgit