diff options
author | Martin Fischer <martin@push-f.com> | 2023-08-19 11:46:27 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2023-08-19 13:41:55 +0200 |
commit | 8eb2a95a483bddc8c6a6a8a30dff68c290277075 (patch) | |
tree | 9d7a587ccccb6289fa9bced703d39729bd8d7d53 | |
parent | 82898967320f90116bbc686ab7ffc2f61ff456c4 (diff) |
break!: remove type param defaults from Tokenizer
-rw-r--r-- | integration_tests/tests/test_html5lib.rs | 6 | ||||
-rw-r--r-- | src/tokenizer.rs | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/integration_tests/tests/test_html5lib.rs b/integration_tests/tests/test_html5lib.rs index 7511f11..fd69524 100644 --- a/integration_tests/tests/test_html5lib.rs +++ b/integration_tests/tests/test_html5lib.rs @@ -3,7 +3,9 @@ use std::{fs::File, io::BufReader, path::Path}; use html5lib_tests::{ parse_tests, Error as TestError, InitialState, Output, Test, Token as TestToken, }; -use html5tokenizer::{reader::Reader, DefaultEmitter, InternalState, Token, Tokenizer}; +use html5tokenizer::{ + offset::NoopOffset, reader::Reader, DefaultEmitter, InternalState, Token, Tokenizer, +}; use similar_asserts::assert_eq; /// Path to a local checkout of [html5lib-tests], relative to the @@ -92,7 +94,7 @@ fn run_test_inner<R: Reader>( test_i: usize, test: &Test, state: &InitialState, - mut tokenizer: Tokenizer<R>, + mut tokenizer: Tokenizer<R, NoopOffset, DefaultEmitter>, tokenizer_info: &str, ) { println!( diff --git a/src/tokenizer.rs b/src/tokenizer.rs index d8f1b95..3a75e60 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -1,10 +1,10 @@ use crate::machine; -use crate::offset::{NoopOffset, Offset, Position}; +use crate::offset::{Offset, Position}; use crate::reader::{IntoReader, Reader}; use crate::utils::{ control_pat, noncharacter_pat, surrogate_pat, ControlToken, State as InternalState, }; -use crate::{DefaultEmitter, Emitter, Error}; +use crate::{Emitter, Error}; // this is a stack that can hold 0 to 2 Ts #[derive(Debug, Default, Clone, Copy)] @@ -33,7 +33,7 @@ impl<T: Copy> Stack2<T> { } /// An HTML tokenizer. See crate-level docs for basic usage. -pub struct Tokenizer<R: Reader, O = NoopOffset, E: Emitter<O> = DefaultEmitter<O>> { +pub struct Tokenizer<R: Reader, O, E: Emitter<O>> { eof: bool, pub(crate) state: InternalState, pub(crate) emitter: E, |