diff --git a/src/catar/chunker.rs b/src/backup/chunker.rs similarity index 97% rename from src/catar/chunker.rs rename to src/backup/chunker.rs index 5e5c2182..39d7d8c8 100644 --- a/src/catar/chunker.rs +++ b/src/backup/chunker.rs @@ -134,7 +134,7 @@ impl Chunker { let copy_len = if need < data_len { need } else { data_len }; unsafe { let src_ptr = data.as_ptr().add(pos); - let mut dest_ptr = self.window.as_mut_ptr().add(self.window_size); + let dest_ptr = self.window.as_mut_ptr().add(self.window_size); std::ptr::copy_nonoverlapping(src_ptr, dest_ptr, copy_len); } pos += copy_len; @@ -178,10 +178,7 @@ impl Chunker { if self.chunk_size < self.chunk_size_min { return false; } - if ((self.h % self.discriminator) == (self.discriminator - 1)) { - return true; - } - false + (self.h % self.discriminator) == (self.discriminator - 1) } fn start(&mut self) { diff --git a/src/bin/backup-client.rs b/src/bin/backup-client.rs index 81b7da69..8797591e 100644 --- a/src/bin/backup-client.rs +++ b/src/bin/backup-client.rs @@ -11,7 +11,7 @@ use proxmox_backup::api::router::*; //use proxmox_backup::backup::image_index::*; //use proxmox_backup::config::datastore; use proxmox_backup::catar::encoder::*; -use proxmox_backup::catar::chunker::*; +use proxmox_backup::backup::chunker::*; use proxmox_backup::backup::datastore::*; use serde_json::{Value}; diff --git a/src/catar.rs b/src/catar.rs index 59c4e3c9..a9688c63 100644 --- a/src/catar.rs +++ b/src/catar.rs @@ -39,7 +39,6 @@ pub mod binary_search_tree; pub mod format_definition; -pub mod chunker; pub mod encoder; pub mod decoder; diff --git a/src/lib.rs b/src/lib.rs index d7e3b0b6..835dad83 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -36,6 +36,7 @@ pub mod section_config; pub mod backup { + pub mod chunker; pub mod chunk_store; pub mod image_index; pub mod datastore;