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 committed Dec 21, 2023
1 parent 38a6537 commit 18622a4
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 @@ -264,6 +264,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 18622a4

Please sign in to comment.