};
extractor.enter_directory(
- OsString::from(format!("testdir")),
+ OsString::from("testdir".to_string()),
dir_metadata.clone(),
true,
)?;
};
assert_eq!(
String::try_from(nw_config).unwrap().trim(),
- format!(
- r#"
+ r#"
iface enp3s0 inet static
- address 10.0.0.100/16"#
- )
+ address 10.0.0.100/16"#.to_string()
.trim()
);
}
};
assert_eq!(
String::try_from(nw_config).unwrap().trim(),
- format!(
- r#"
+ r#"
iface enp3s0 inet static
address 10.0.0.100/16
- gateway 10.0.0.1"#
- )
+ gateway 10.0.0.1"#.to_string()
.trim()
);
}
for drive in drives.iter_mut() {
for drive2 in &page.drives {
if drive2.element_address == drive.element_address {
- drive.vendor = drive2.vendor.clone();
- drive.model = drive2.model.clone();
- drive.drive_serial_number = drive2.drive_serial_number.clone();
+ drive.vendor.clone_from(&drive2.vendor);
+ drive.model.clone_from(&drive2.model);
+ drive.drive_serial_number.clone_from(&drive2.drive_serial_number);
}
}
}
crypt_config: Option<Arc<CryptConfig>>,
) -> Result<pbs_pxar_fuse::Accessor, Error> {
let (archive_name, payload_archive_name) =
- pbs_client::tools::get_pxar_archive_names(archive_name, &manifest)?;
+ pbs_client::tools::get_pxar_archive_names(archive_name, manifest)?;
let (reader, archive_size) = get_pxar_fuse_reader(
&archive_name,
});
let payload_stats = client.upload_stream(
- &payload_target,
+ payload_target,
stream,
upload_options,
Some(payload_injections_rx),
let prelude_path = param["prelude-target"]
.as_str()
- .map(|path| PathBuf::from(path));
+ .map(PathBuf::from);
let options = pbs_client::pxar::PxarExtractOptions {
match_list: &[],
}
}
} else if server_archive_name.ends_with(".fidx") {
- let file_info = manifest.lookup_file_info(&archive_name)?;
+ let file_info = manifest.lookup_file_info(archive_name)?;
let index = client
.download_fixed_index(&manifest, &server_archive_name)
.await?;
pbs_client::tools::pxar_metadata_catalog_lookup(
accessor,
- &path,
+ path,
Some(&archive_name),
)
.await
crypt_config: Option<Arc<CryptConfig>>,
) -> Result<(LocalDynamicReadAt<RemoteChunkReader>, u64), Error> {
let index = client
- .download_dynamic_index(&manifest, &archive_name)
+ .download_dynamic_index(manifest, archive_name)
.await?;
let most_used = index.find_most_used_chunks(8);
- let file_info = manifest.lookup_file_info(&archive_name)?;
+ let file_info = manifest.lookup_file_info(archive_name)?;
let chunk_reader = RemoteChunkReader::new(
client.clone(),
crypt_config,
overwrite_flags,
extract_match_default,
on_error,
- prelude_path: prelude_target.map(|path| PathBuf::from(path)),
+ prelude_path: prelude_target.map(PathBuf::from),
};
if archive == "-" {
let archive = Path::new(&archive);
let mountpoint = Path::new(&mountpoint);
let options = OsStr::new("ro,default_permissions");
- let payload_input = payload_input.map(|payload_input| PathBuf::from(payload_input));
+ let payload_input = payload_input.map(PathBuf::from);
let session = pbs_pxar_fuse::Session::mount_path(
archive,
let src_dir = "../tests/catar_data/test_xattrs_src/";
let dest_dir = "../tests/catar_data/test_xattrs_dest/";
- let target_subdir = std::env::var("DEB_HOST_RUST_TYPE").unwrap_or(String::new());
+ let target_subdir = std::env::var("DEB_HOST_RUST_TYPE").unwrap_or_default();
let exec_path = if cfg!(debug_assertions) {
format!("../target/{target_subdir}/debug/pxar")
#[test]
fn pxar_list_with_payload_input() {
- let target_subdir = std::env::var("DEB_HOST_RUST_TYPE").unwrap_or(String::new());
+ let target_subdir = std::env::var("DEB_HOST_RUST_TYPE").unwrap_or_default();
let exec_path = if cfg!(debug_assertions) {
format!("../target/{target_subdir}/debug/pxar")
format!("../target/{target_subdir}/release/pxar")
};
- let output = Command::new(&exec_path)
+ let output = Command::new(exec_path)
.args([
"list",
"../tests/pxar/backup-client-pxar-expected.mpxar",
if encryption_key_fingerprint.is_none()
&& set.encryption_key_fingerprint.is_some()
{
- encryption_key_fingerprint = set.encryption_key_fingerprint.clone();
+ encryption_key_fingerprint.clone_from(&set.encryption_key_fingerprint);
}
}
media_id_list.push(media_id);
if list.len() == 1 && old_len != 1 && list[0].ends_with('/') {
// we added only one match and it was a directory, lookup again
- lookup_path = list[0].clone();
+ lookup_path.clone_from(&list[0]);
filter = "";
continue;
}
let value = LdapSyncAttributes::API_SCHEMA.parse_property_string(sync_attributes)?;
let sync_attributes: LdapSyncAttributes = serde_json::from_value(value)?;
- email = sync_attributes.email.clone();
- firstname = sync_attributes.firstname.clone();
- lastname = sync_attributes.lastname.clone();
+ email.clone_from(&sync_attributes.email);
+ firstname.clone_from(&sync_attributes.firstname);
+ lastname.clone_from(&sync_attributes.lastname);
if let Some(email_attr) = &sync_attributes.email {
attributes.push(email_attr.clone());
_ => used,
};
if used == PartitionUsageType::FileSystem {
- filesystem = info.file_system_type.clone();
+ filesystem.clone_from(&info.file_system_type);
}
}
}