mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-07-05 19:18:43 +08:00
Remove ProgressBarWrite
It is unused.
This commit is contained in:
parent
5fed46f97e
commit
64ea29f63b
@ -23,29 +23,3 @@ impl<'p, 'r, P: Write, R: Read> Read for ProgressBarRead<'p, 'r, P, R> {
|
|||||||
Ok(count)
|
Ok(count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct ProgressBarWrite<'p, 'w, P: Write + 'p, W: Write + 'w> {
|
|
||||||
pb: &'p mut ProgressBar<P>,
|
|
||||||
w: &'w mut W,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'p, 'w, P: Write, W: Write> ProgressBarWrite<'p, 'w, P, W> {
|
|
||||||
pub fn _new(pb: &'p mut ProgressBar<P>, w: &'w mut W) -> ProgressBarWrite<'p, 'w, P, W> {
|
|
||||||
ProgressBarWrite {
|
|
||||||
pb,
|
|
||||||
w
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'p, 'w, P: Write, W: Write> Write for ProgressBarWrite<'p, 'w, P, W> {
|
|
||||||
fn write(&mut self, buf: &[u8]) -> Result<usize> {
|
|
||||||
let count = self.w.write(buf)?;
|
|
||||||
self.pb.add(count as u64);
|
|
||||||
Ok(count)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn flush(&mut self) -> Result<()> {
|
|
||||||
self.w.flush()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user