diff options
-rw-r--r-- | CHANGELOG.md | 8 | ||||
-rw-r--r-- | src/naive_parser.rs | 4 | ||||
-rw-r--r-- | src/tokenizer.rs | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8af61ff..1fa3b76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # html5tokenizer changelog +### [unreleased] + +#### Breaking changes + +* Added missing `R: Position<O>` bounds for `Tokenizer`/`NaiveParser` constructors. + (If you are able to construct a Tokenizer/NaiveParser, + you should be able to iterate over it.) + ### 0.5.0 - 2023-08-19 #### Features 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<R: Reader, O: Offset, E: Emitter<O>> { tokenizer: Tokenizer<R, O, E>, } -impl<R: Reader, O: Offset> NaiveParser<R, O, DefaultEmitter<O>> { +impl<R: Reader + Position<O>, O: Offset> NaiveParser<R, O, DefaultEmitter<O>> { /// 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<R: Reader + Position<usize>> NaiveParser<R, usize, DefaultEmitter<usize>> { } } -impl<R: Reader, O: Offset, E: Emitter<O>> NaiveParser<R, O, E> { +impl<R: Reader + Position<O>, O: Offset, E: Emitter<O>> NaiveParser<R, O, E> { /// 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<R: Reader, O, E: Emitter<O>> { pub(crate) naively_switch_state: bool, } -impl<R: Reader, O: Offset, E: Emitter<O>> Tokenizer<R, O, E> { +impl<R: Reader + Position<O>, O: Offset, E: Emitter<O>> Tokenizer<R, O, E> { /// Creates a new tokenizer from some input and an emitter. /// /// Note that properly parsing HTML with this tokenizer requires you to |