Skip to content

Commit

Permalink
Allow borrowing the underlying reader for rbsp::ByteReader
Browse files Browse the repository at this point in the history
  • Loading branch information
jensenn authored and scottlamb committed Jan 15, 2024
1 parent 8cae231 commit 87dce50
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rbsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ impl<R: BufRead> ByteReader<R> {
}
Ok(true)
}

/// Borrows the underlying reader
pub fn reader(&mut self) -> &mut R {
&mut self.inner
}
}
impl<R: BufRead> Read for ByteReader<R> {
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
Expand Down

0 comments on commit 87dce50

Please sign in to comment.