X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-core%2Fsrc%2Fio%2Fbyteio.rs;h=adbb6369264ae3e3bd02fd6e96b9a14264945665;hp=3677501ae9f1c537ba03df96ad6889b5703bb1d0;hb=ac818eac7671fa8ddfea5aa4fb86fc0b5ab82d2e;hpb=73f0f89ff3a3616a8e65b5a31c2303725994c56a diff --git a/nihav-core/src/io/byteio.rs b/nihav-core/src/io/byteio.rs index 3677501..adbb636 100644 --- a/nihav-core/src/io/byteio.rs +++ b/nihav-core/src/io/byteio.rs @@ -75,7 +75,7 @@ pub trait ByteIO { /// [`MemoryReader`]: ./struct.MemoryReader.html #[allow(dead_code)] pub struct ByteReader<'a> { - io: &'a mut ByteIO, + io: &'a mut dyn ByteIO, } /// Bytestream reader from memory. @@ -241,7 +241,7 @@ impl<'a> ByteReader<'a> { /// # Ok(()) /// # } /// ```` - pub fn new(io: &'a mut ByteIO) -> Self { ByteReader { io } } + pub fn new(io: &'a mut dyn ByteIO) -> Self { ByteReader { io } } /// Reads data into provided buffer. Partial read is treated as success. pub fn read_buf(&mut self, buf: &mut [u8]) -> ByteIOResult { @@ -639,7 +639,7 @@ impl ByteIO for FileReader { /// [`MemoryWriter`]: ./struct.MemoryWriter.html #[allow(dead_code)] pub struct ByteWriter<'a> { - io: &'a mut ByteIO, + io: &'a mut dyn ByteIO, } /// Bytestream writer to memory. @@ -665,7 +665,7 @@ pub struct GrowableMemoryWriter<'a> { impl<'a> ByteWriter<'a> { /// Constructs a new instance of `ByteWriter`. - pub fn new(io: &'a mut ByteIO) -> Self { ByteWriter { io } } + pub fn new(io: &'a mut dyn ByteIO) -> Self { ByteWriter { io } } /// Writes byte array to the output. pub fn write_buf(&mut self, buf: &[u8]) -> ByteIOResult<()> {