diff options
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r-- | src/tokenizer.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs index ee8f893..b2d4b53 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -4,7 +4,7 @@ use crate::machine; use crate::utils::{ control_pat, noncharacter_pat, surrogate_pat, ControlToken, State as InternalState, }; -use crate::{DefaultEmitter, Emitter, Error, Never, Readable, Reader}; +use crate::{DefaultEmitter, Emitter, Error, IntoReader, Never, Reader}; // this is a stack that can hold 0 to 2 Ts #[derive(Debug, Default, Clone, Copy)] @@ -49,7 +49,7 @@ impl<R: Reader> Tokenizer<R> { /// /// Patches are welcome for providing an efficient implementation over async streams, /// iterators, files, etc, as long as any dependencies come behind featureflags. - pub fn new<'a, S: Readable<'a, Reader = R>>(input: S) -> Self { + pub fn new<'a, S: IntoReader<'a, Reader = R>>(input: S) -> Self { Tokenizer::<S::Reader>::new_with_emitter(input, DefaultEmitter::default()) } } @@ -93,14 +93,14 @@ impl<R: Reader, E: Emitter<R>> Tokenizer<R, E> { /// /// Use this method over [`Tokenizer::new`] when you want to have more control over string allocation for /// tokens. - pub fn new_with_emitter<'a, S: Readable<'a, Reader = R>>(input: S, emitter: E) -> Self { + pub fn new_with_emitter<'a, S: IntoReader<'a, Reader = R>>(input: S, emitter: E) -> Self { Tokenizer { eof: false, state: InternalState::Data, emitter, temporary_buffer: String::new(), to_reconsume: Stack2::default(), - reader: input.to_reader(), + reader: input.into_reader(), character_reference_code: 0, return_state: None, } |