From: Kostya Shishkov Date: Thu, 13 Feb 2020 18:20:26 +0000 (+0100) Subject: core/io: make bitstream reader clone()able X-Git-Url: https://git.nihav.org/?p=nihav.git;a=commitdiff_plain;h=91f5ad848e8c89177c41e9ac8dc3d3125a1acdd7 core/io: make bitstream reader clone()able --- diff --git a/nihav-core/src/io/bitreader.rs b/nihav-core/src/io/bitreader.rs index 1163326..26b95a6 100644 --- a/nihav-core/src/io/bitreader.rs +++ b/nihav-core/src/io/bitreader.rs @@ -35,7 +35,7 @@ /// Bitstream reading modes. -#[derive(Debug)] +#[derive(Debug,Clone,Copy)] pub enum BitReaderMode { /// The stream is big endian MSB first. BE, @@ -48,7 +48,7 @@ pub enum BitReaderMode { } /// A list specifying general bitstream reading errors. -#[derive(Debug)] +#[derive(Debug,Clone,Copy)] pub enum BitReaderError { /// The reader is at the end of bitstream. BitstreamEnd, @@ -64,7 +64,7 @@ use self::BitReaderError::*; pub type BitReaderResult = Result; /// Bitstream reader. -#[derive(Debug)] +#[derive(Debug,Clone)] pub struct BitReader<'a> { cache: u64, bits: u8,