From ec8f612754a516797589d23cf08b60ae406a2e96 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Mon, 28 Aug 2023 18:35:59 +0200 Subject: fix!: add missing `R: Position` bounds It doesn't make sense that you're able to construct a Tokenizer/NaiveParser that you're unable to iterate over. --- src/naive_parser.rs | 4 ++-- src/tokenizer.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/naive_parser.rs b/src/naive_parser.rs index e229592..ecf170a 100644 --- a/src/naive_parser.rs +++ b/src/naive_parser.rs @@ -19,7 +19,7 @@ pub struct NaiveParser> { tokenizer: Tokenizer, } -impl NaiveParser> { +impl, O: Offset> NaiveParser> { /// Constructs a new naive parser. // TODO: add example for NaiveParser::new pub fn new<'a>(reader: impl IntoReader<'a, Reader = R>) -> Self { @@ -39,7 +39,7 @@ impl> NaiveParser> { } } -impl> NaiveParser { +impl, O: Offset, E: Emitter> NaiveParser { /// Constructs a new naive parser with a custom emitter. // TODO: add example for NaiveParser::new_with_emitter pub fn new_with_emitter<'a>(reader: impl IntoReader<'a, Reader = R>, emitter: E) -> Self { diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 7cc4712..05c1165 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -57,7 +57,7 @@ pub struct Tokenizer> { pub(crate) naively_switch_state: bool, } -impl> Tokenizer { +impl, O: Offset, E: Emitter> Tokenizer { /// Creates a new tokenizer from some input and an emitter. /// /// Note that properly parsing HTML with this tokenizer requires you to -- cgit v1.2.3