aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-08-11 22:55:47 +0200
committerMartin Fischer <martin@push-f.com>2023-08-19 06:41:55 +0200
commit2c6021ffa738b38be9a51a6ba4872d018404afc1 (patch)
treee2cbe2b23f4931f2e63ce5b38c2c2b0e35a4766b /src
parent620deab83d13d9aeca3bb894e6fc20c516c1405f (diff)
break!: rename PosTracker to PosTrackingReader
Diffstat (limited to 'src')
-rw-r--r--src/spans.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/spans.rs b/src/spans.rs
index ee63dd3..4333bd1 100644
--- a/src/spans.rs
+++ b/src/spans.rs
@@ -7,7 +7,7 @@
//! * one for [`Range<usize>`] for when you do want to track spans
//!
//! To use the latter your reader however has to implement [`GetPos`].
-//! You can easily use any existing reader by wrapping it in the [`PosTracker`] struct
+//! You can easily use any existing reader by wrapping it in the [`PosTrackingReader`] struct
//! which implements the [`GetPos`] trait and takes care of tracking the current position.
use std::ops::Range;
@@ -21,14 +21,14 @@ pub trait GetPos {
}
/// Wraps a [`Reader`] so that it implements [`GetPos`].
-pub struct PosTracker<R> {
+pub struct PosTrackingReader<R> {
/// The wrapped reader.
pub reader: R,
/// The current position.
pub position: usize,
}
-impl<R> GetPos for PosTracker<R> {
+impl<R> GetPos for PosTrackingReader<R> {
fn get_pos(&self) -> usize {
self.position
}
@@ -68,7 +68,7 @@ impl<P: GetPos> Span<P> for Range<usize> {
}
}
-impl<R: Reader> Reader for PosTracker<R> {
+impl<R: Reader> Reader for PosTrackingReader<R> {
type Error = R::Error;
fn read_char(&mut self) -> Result<Option<char>, Self::Error> {