Skip to content

Commit

Permalink
Remove write_all from wrap_write
Browse files Browse the repository at this point in the history
By implementing `write_all` we loose granularity of progress updates
that are captured from `write`.  Therefore, remove this function.
  • Loading branch information
hexagonal-sun authored and djc committed Sep 5, 2022
1 parent 81cca1e commit a466096
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/iter.rs
Expand Up @@ -287,12 +287,6 @@ impl<W: io::Write> io::Write for ProgressBarIter<W> {
self.it.flush()
}

fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
self.it.write_all(buf).map(|()| {
self.progress.inc(buf.len() as u64);
})
}

// write_fmt can not be captured with reasonable effort.
// as it uses write_all internally by default that should not be a problem.
// fn write_fmt(&mut self, fmt: fmt::Arguments) -> io::Result<()>;
Expand Down

0 comments on commit a466096

Please sign in to comment.