diff --git a/src/backup/index.rs b/src/backup/index.rs index 1cad4e69..80501287 100644 --- a/src/backup/index.rs +++ b/src/backup/index.rs @@ -2,43 +2,3 @@ pub trait IndexFile { fn index_count(&self) -> usize; fn index_digest(&self, pos: usize) -> Option<&[u8; 32]>; } - -pub struct IndexIterator { - pos: usize, - count: usize, - reader: Box, -} - -impl Iterator for IndexIterator { - type Item = [u8; 32]; - - fn next(&mut self) -> Option { - if self.pos == self.count { - return None; - } - - let digest = self.reader.index_digest(self.pos).unwrap(); - self.pos += 1; - Some(*digest) - } -} - -impl From> for IndexIterator { - fn from(file: Box) -> Self { - Self { - pos: 0, - count: file.index_count(), - reader: file, - } - } -} - -impl From> for IndexIterator { - fn from(file: Box) -> Self { - Self { - pos: 0, - count: file.index_count(), - reader: file, - } - } -}