src/backup/read_chunk.rs: use &mut self

This commit is contained in:
Dietmar Maurer 2019-07-03 14:25:18 +02:00
parent 0d70535a36
commit 1e0784841c

View File

@ -8,7 +8,7 @@ use super::data_chunk::*;
/// The ReadChunk trait allows reading backup data chunks (local or remote) /// The ReadChunk trait allows reading backup data chunks (local or remote)
pub trait ReadChunk { pub trait ReadChunk {
/// Returns the decoded chunk data /// Returns the decoded chunk data
fn read_chunk(&self, digest:&[u8; 32]) -> Result<Vec<u8>, Error>; fn read_chunk(&mut self, digest:&[u8; 32]) -> Result<Vec<u8>, Error>;
} }
pub struct LocalChunkReader { pub struct LocalChunkReader {
@ -25,7 +25,7 @@ impl LocalChunkReader {
impl ReadChunk for LocalChunkReader { impl ReadChunk for LocalChunkReader {
fn read_chunk(&self, digest:&[u8; 32]) -> Result<Vec<u8>, Error> { fn read_chunk(&mut self, digest:&[u8; 32]) -> Result<Vec<u8>, Error> {
let digest_str = proxmox::tools::digest_to_hex(digest); let digest_str = proxmox::tools::digest_to_hex(digest);
println!("READ CHUNK {}", digest_str); println!("READ CHUNK {}", digest_str);