tree-wide: fix needless borrows

found and fixed via clippy

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2021-12-30 12:57:37 +01:00
parent a0c69902c8
commit 9a37bd6c84
104 changed files with 238 additions and 241 deletions

View File

@ -90,8 +90,8 @@ async fn dump_catalog(param: Value) -> Result<Value, Error> {
client,
crypt_config.clone(),
repo.store(),
&snapshot.group().backup_type(),
&snapshot.group().backup_id(),
snapshot.group().backup_type(),
snapshot.group().backup_id(),
snapshot.backup_time(),
true,
).await?;
@ -103,7 +103,7 @@ async fn dump_catalog(param: Value) -> Result<Value, Error> {
let most_used = index.find_most_used_chunks(8);
let file_info = manifest.lookup_file_info(&CATALOG_NAME)?;
let file_info = manifest.lookup_file_info(CATALOG_NAME)?;
let chunk_reader = RemoteChunkReader::new(client.clone(), crypt_config, file_info.chunk_crypt_mode(), most_used);
@ -232,7 +232,7 @@ async fn catalog_shell(param: Value) -> Result<(), Error> {
let most_used = index.find_most_used_chunks(8);
let file_info = manifest.lookup_file_info(&CATALOG_NAME)?;
let file_info = manifest.lookup_file_info(CATALOG_NAME)?;
let chunk_reader = RemoteChunkReader::new(client.clone(), crypt_config, file_info.chunk_crypt_mode(), most_used);
let mut reader = BufferedDynamicReader::new(index, chunk_reader);
let mut catalogfile = std::fs::OpenOptions::new()

View File

@ -654,7 +654,7 @@ async fn create_backup(
let crypto = crypto_parameters(&param)?;
let backup_id = param["backup-id"].as_str().unwrap_or(&proxmox_sys::nodename());
let backup_id = param["backup-id"].as_str().unwrap_or(proxmox_sys::nodename());
let backup_type = param["backup-type"].as_str().unwrap_or("host");
@ -794,7 +794,7 @@ async fn create_backup(
crypt_config.clone(),
repo.store(),
backup_type,
&backup_id,
backup_id,
backup_time,
verbose,
false
@ -1003,7 +1003,7 @@ async fn dump_image<W: Write>(
for pos in 0..index.index_count() {
let digest = index.index_digest(pos).unwrap();
let raw_data = chunk_reader.read_chunk(&digest).await?;
let raw_data = chunk_reader.read_chunk(digest).await?;
writer.write_all(&raw_data)?;
bytes += raw_data.len();
if verbose {

View File

@ -259,7 +259,7 @@ async fn mount_do(param: Value, pipe: Option<Fd>) -> Result<Value, Error> {
let session = pbs_client::pxar::fuse::Session::mount(
decoder,
&options,
options,
false,
Path::new(target.unwrap()),
)