aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-08-11 21:42:18 +0200
committerMartin Fischer <martin@push-f.com>2023-08-19 06:41:55 +0200
commit36fbad12e7a50fcae3cc5e9e2d2baccd828115a5 (patch)
treec200a7dc3feb3bf869c99beab01f5dbf9d12ce4c /src/tokenizer.rs
parentc00d5cdec03364f064a1273a5d806f3600abf09a (diff)
break!: rename Readable to IntoReader
The trait of the standard library is also called IntoIterator and not Iterable.
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r--src/tokenizer.rs8
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,
}