src/client/http_client.rs: minor code cleanup

This commit is contained in:
Dietmar Maurer 2019-08-06 11:46:15 +02:00
parent f889b15867
commit bd15e96dd9

View File

@ -660,14 +660,14 @@ impl BackupClient {
DataBlob::encode(&contents, None, compress)?
};
let raw_data = blob.into_inner();
Ok((raw_data, contents.len()))
Ok((raw_data, contents.len() as u64))
})
.and_then(move |(raw_data, size)| {
let csum = openssl::sha::sha256(&raw_data);
let param = json!({"encoded-size": raw_data.len(), "file-name": file_name });
h2.upload("blob", Some(param), raw_data)
.map(move |_| {
BackupStats { size: size as u64, csum }
BackupStats { size, csum }
})
})
});