1
0
Fork 0
mirror of https://codeberg.org/icewind/bitbuffer.git synced 2026-06-03 16:44:06 +02:00

impl Clone for BitStream

This commit is contained in:
Robin Appelman 2019-02-28 21:56:01 +01:00
commit 5e7a68a57e

View file

@ -518,6 +518,17 @@ where
}
}
impl<E: Endianness> Clone for BitStream<E> {
fn clone(&self) -> Self {
BitStream {
buffer: Rc::clone(&self.buffer),
start_pos: self.pos,
pos: self.pos,
bit_len: self.bit_len,
}
}
}
impl<E: Endianness> From<BitBuffer<E>> for BitStream<E> {
fn from(buffer: BitBuffer<E>) -> Self {
BitStream::new(buffer)