src/backup/data_blob.rs: avoid Arc<CryptConfig>

use simple reference instead.
This commit is contained in:
Dietmar Maurer
2019-10-07 11:36:39 +02:00
parent 4ee8f53d07
commit 7123ff7d43
6 changed files with 15 additions and 16 deletions

View File

@ -888,7 +888,7 @@ async fn download_index_blob(client: Arc<BackupReader>, crypt_config: Option<Arc
let index_data = client.download(INDEX_BLOB_NAME, Vec::with_capacity(64*1024)).await?;
let blob = DataBlob::from_raw(index_data)?;
blob.verify_crc()?;
blob.decode(crypt_config)
blob.decode(crypt_config.as_ref().map(Arc::as_ref))
}
fn verify_index_file(backup_index: &Value, name: &str, csum: &[u8; 32], size: u64) -> Result<(), Error> {
@ -1159,7 +1159,7 @@ fn upload_log(
let data = file_get_contents(logfile)?;
let blob = DataBlob::encode(&data, crypt_config, true)?;
let blob = DataBlob::encode(&data, crypt_config.as_ref().map(Arc::as_ref), true)?;
let raw_data = blob.into_inner();