Skip to content

Commit

Permalink
Add into_reader() function for rbsp::BitReader
Browse files Browse the repository at this point in the history
  • Loading branch information
jensenn authored and scottlamb committed Jan 15, 2024
1 parent 87dce50 commit 71b22f8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/rbsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,15 @@ impl<R: std::io::BufRead + Clone> BitReader<R> {
pub fn reader(&mut self) -> Option<&mut R> {
self.reader.reader()
}

/// Unwraps internal reader and disposes of BitReader.
///
/// # Warning
///
/// Any unread partial bits are discarded.
pub fn into_reader(self) -> R {
self.reader.into_reader()
}
}

impl<R: std::io::BufRead + Clone> BitRead for BitReader<R> {
Expand Down

0 comments on commit 71b22f8

Please sign in to comment.