diff options
Diffstat (limited to 'vendor/gix-pack/src/index/util.rs')
-rw-r--r-- | vendor/gix-pack/src/index/util.rs | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/vendor/gix-pack/src/index/util.rs b/vendor/gix-pack/src/index/util.rs index 284ee6158..2549429f9 100644 --- a/vendor/gix-pack/src/index/util.rs +++ b/vendor/gix-pack/src/index/util.rs @@ -1,10 +1,10 @@ -use std::{io, time::Instant}; +use std::time::Instant; use gix_features::progress::{self, Progress}; pub(crate) fn index_entries_sorted_by_offset_ascending( idx: &crate::index::File, - mut progress: impl Progress, + progress: &mut dyn Progress, ) -> Vec<crate::index::Entry> { progress.init(Some(idx.num_objects as usize), progress::count("entries")); let start = Instant::now(); @@ -19,29 +19,3 @@ pub(crate) fn index_entries_sorted_by_offset_ascending( progress.show_throughput(start); v } - -pub(crate) struct Count<W> { - pub bytes: u64, - pub inner: W, -} - -impl<W> Count<W> { - pub fn new(inner: W) -> Self { - Count { bytes: 0, inner } - } -} - -impl<W> io::Write for Count<W> -where - W: io::Write, -{ - fn write(&mut self, buf: &[u8]) -> io::Result<usize> { - let written = self.inner.write(buf)?; - self.bytes += written as u64; - Ok(written) - } - - fn flush(&mut self) -> io::Result<()> { - self.inner.flush() - } -} |