core/io: make bitstream reader clone()able
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 13 Feb 2020 18:20:26 +0000 (19:20 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 13 Feb 2020 18:20:26 +0000 (19:20 +0100)
nihav-core/src/io/bitreader.rs

index 11633266068024d02fc339bba23be465033944a4..26b95a66c98704b203f18d33286b0189398051ee 100644 (file)
@@ -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<T> = Result<T, BitReaderError>;
 
 /// Bitstream reader.
-#[derive(Debug)]
+#[derive(Debug,Clone)]
 pub struct BitReader<'a> {
     cache: u64,
     bits:  u8,