From 18622a49f0a7486473605dcf47502f1681b9a719 Mon Sep 17 00:00:00 2001 From: Jensenn Date: Thu, 21 Dec 2023 14:40:30 -0700 Subject: [PATCH] Add into_reader() function for rbsp::BitReader --- src/rbsp.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rbsp.rs b/src/rbsp.rs index cffe6b7..54e242f 100644 --- a/src/rbsp.rs +++ b/src/rbsp.rs @@ -264,6 +264,15 @@ impl BitReader { 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 BitRead for BitReader {