diff --git a/src/api2/admin/datastore/backup.rs b/src/api2/admin/datastore/backup.rs index c911d3ee..5793fe4b 100644 --- a/src/api2/admin/datastore/backup.rs +++ b/src/api2/admin/datastore/backup.rs @@ -381,7 +381,7 @@ fn dynamic_chunk_index( env.register_chunk(digest, size)?; } - let reader = ChunkListReader::new(Box::new(index)); + let reader = DigestListEncoder::new(Box::new(index)); let stream = WrappedReaderStream::new(reader); diff --git a/src/backup/index.rs b/src/backup/index.rs index 29a0d54a..fd375244 100644 --- a/src/backup/index.rs +++ b/src/backup/index.rs @@ -7,16 +7,16 @@ pub trait IndexFile: Send { fn index_digest(&self, pos: usize) -> Option<&[u8; 32]>; } -/// This struct can read the list of chunks from an `IndexFile` +/// Encode digest list from an `IndexFile` into a binary stream /// /// The reader simply returns a birary stream of 32 byte digest values. -pub struct ChunkListReader { +pub struct DigestListEncoder { index: Box, pos: usize, count: usize, } -impl ChunkListReader { +impl DigestListEncoder { pub fn new(index: Box) -> Self { let count = index.index_count(); @@ -24,7 +24,7 @@ impl ChunkListReader { } } -impl std::io::Read for ChunkListReader { +impl std::io::Read for DigestListEncoder { fn read(&mut self, buf: &mut [u8]) -> Result { if buf.len() < 32 { panic!("read buffer too small"); }