Skip to content

Commit

Permalink
Add a From<DeferredReader> for LineReader instance
Browse files Browse the repository at this point in the history
  • Loading branch information
jix committed Dec 26, 2021
1 parent 71e74c9 commit 4b2124a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flussab/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@ pub struct LineReader<'a> {
pub line_start: usize,
}

impl<'a> From<DeferredReader<'a>> for LineReader<'a> {
fn from(reader: DeferredReader<'a>) -> Self {
Self::new(reader)
}
}

impl<'a> LineReader<'a> {
/// Creates a `LineReader` assuming line 1 starts at the current position of the passed
/// [`DeferredReader`].
Expand Down

0 comments on commit 4b2124a

Please sign in to comment.