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:
parent
ccced2c28e
commit
5e7a68a57e
1 changed files with 11 additions and 0 deletions
|
|
@ -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> {
|
impl<E: Endianness> From<BitBuffer<E>> for BitStream<E> {
|
||||||
fn from(buffer: BitBuffer<E>) -> Self {
|
fn from(buffer: BitBuffer<E>) -> Self {
|
||||||
BitStream::new(buffer)
|
BitStream::new(buffer)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue