Skip to content

Commit 0c55508

Browse files
committed
mono
1 parent 3834ea0 commit 0c55508

File tree

3 files changed

+391
-420
lines changed

3 files changed

+391
-420
lines changed

remoc/src/rch/base/io.rs

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
use bytes::{Buf, Bytes, BytesMut};
2-
use std::io::{self, BufWriter};
3-
4-
use crate::chmux::DataBuf;
2+
use std::io;
53

64
/// Writes to an internal memory buffer with a limited maximum size.
75
pub struct LimitedBytesWriter {
@@ -82,27 +80,6 @@ impl io::Write for ChannelBytesWriter {
8280
}
8381
}
8482

85-
pub(crate) enum IoWriter<'a> {
86-
Limited(&'a mut LimitedBytesWriter),
87-
Channel(&'a mut BufWriter<ChannelBytesWriter>),
88-
}
89-
90-
impl<'a> io::Write for IoWriter<'a> {
91-
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
92-
match self {
93-
Self::Limited(w) => w.write(buf),
94-
Self::Channel(w) => w.write(buf),
95-
}
96-
}
97-
98-
fn flush(&mut self) -> io::Result<()> {
99-
match self {
100-
Self::Limited(w) => w.flush(),
101-
Self::Channel(w) => w.flush(),
102-
}
103-
}
104-
}
105-
10683
/// Reads data from an mpsc channel.
10784
///
10885
/// This must not be used in an async thread.
@@ -140,16 +117,4 @@ impl io::Read for ChannelBytesReader {
140117
}
141118
}
142119

143-
pub(crate) enum IoReader<'a, 'b> {
144-
DataBuf(&'a mut bytes::buf::Reader<&'b mut DataBuf>),
145-
Channel(&'a mut ChannelBytesReader),
146-
}
147120

148-
impl<'a, 'b> io::Read for IoReader<'a, 'b> {
149-
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
150-
match self {
151-
Self::DataBuf(r) => r.read(buf),
152-
Self::Channel(r) => r.read(buf),
153-
}
154-
}
155-
}

0 commit comments

Comments
 (0)