diff options
author | Martin Fischer <martin@push-f.com> | 2023-08-28 18:35:59 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2023-09-03 23:00:05 +0200 |
commit | ec8f612754a516797589d23cf08b60ae406a2e96 (patch) | |
tree | 067c064feecdb2559d5c9a7bf2ea2b4ee282d8f0 /src/naive_parser.rs | |
parent | 632a14059b24a9435efe4df6c186a36947938475 (diff) |
fix!: add missing `R: Position<O>` bounds
It doesn't make sense that you're able to construct
a Tokenizer/NaiveParser that you're unable to iterate over.
Diffstat (limited to 'src/naive_parser.rs')
-rw-r--r-- | src/naive_parser.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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 { |