Skip to content

Commit

Permalink
Add some docs to LineColIterator, expose the underlying iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
erickt committed Apr 26, 2015
1 parent 75af812 commit cf38b8d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,21 @@ impl<Iter: Iterator<Item=io::Result<u8>>> LineColIterator<Iter> {
rdr: iter,
}
}

/// Report the current line inside the iterator.
pub fn line(&self) -> usize { self.line }

/// Report the current column inside the iterator.
pub fn col(&self) -> usize { self.col }

/// Gets a reference to the underlying iterator.
pub fn get_ref(&self) -> &Iter { &self.iter }

/// Gets a mutable reference to the underlying iterator.
pub fn get_mut(&self) -> &Iter { &self.iter }

/// Unwraps this `LineColIterator`, returning the underlying iterator.
pub fn into_inner(self) -> Iter { self.iter }
}

impl<Iter: Iterator<Item=io::Result<u8>>> Iterator for LineColIterator<Iter> {
Expand Down

0 comments on commit cf38b8d

Please sign in to comment.