mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-26 15:32:30 +00:00
kata-types: Fix needless_borrow warnings
As we bumped the rust toolchain to 1.66.0, some new warnings have been raised due to needless_borrow. Let's fix them all here. For more info about the warnings, please, take a look at: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
126187e814
commit
cf9ef1833c
@ -240,7 +240,7 @@ mod drop_in_directory_handling {
|
||||
"drop-in cfg file can only be a regular file or a symlink",
|
||||
));
|
||||
}
|
||||
let dropin_contents = fs::read_to_string(&dropin_file.path())?;
|
||||
let dropin_contents = fs::read_to_string(dropin_file.path())?;
|
||||
let dropin_config: toml::Value = toml::from_str(&dropin_contents)?;
|
||||
super::toml_tree_ops::merge(base_config, dropin_config);
|
||||
Ok(())
|
||||
@ -267,7 +267,7 @@ mod drop_in_directory_handling {
|
||||
}
|
||||
|
||||
pub fn load(base_cfg_file_path: &Path) -> Result<TomlConfig> {
|
||||
let base_toml_str = fs::read_to_string(&base_cfg_file_path)?;
|
||||
let base_toml_str = fs::read_to_string(base_cfg_file_path)?;
|
||||
let mut base_config: toml::Value = toml::from_str(&base_toml_str)?;
|
||||
let dropin_dir = get_dropin_dir_path(base_cfg_file_path)?;
|
||||
|
||||
@ -324,7 +324,7 @@ mod drop_in_directory_handling {
|
||||
create_file(&config_path, BASE_CONFIG_DATA.as_bytes()).unwrap();
|
||||
|
||||
let dropin_dir = tmpdir.path().join("config.d");
|
||||
fs::create_dir(&dropin_dir).unwrap();
|
||||
fs::create_dir(dropin_dir).unwrap();
|
||||
|
||||
let config = load(&config_path).unwrap();
|
||||
check_base_config(&config);
|
||||
|
@ -340,7 +340,7 @@ mod tests {
|
||||
|
||||
let path = env!("CARGO_MANIFEST_DIR");
|
||||
let path = Path::new(path).join("tests/texture/configuration-anno-0.toml");
|
||||
let content = fs::read_to_string(&path).unwrap();
|
||||
let content = fs::read_to_string(path).unwrap();
|
||||
let mut config = TomlConfig::load(&content).unwrap();
|
||||
assert!(anno.update_config_by_annotation(&mut config).is_err());
|
||||
}
|
||||
@ -349,7 +349,7 @@ mod tests {
|
||||
fn test_fail_to_change_kernel_path_because_of_invalid_path() {
|
||||
let path = env!("CARGO_MANIFEST_DIR");
|
||||
let path = Path::new(path).join("tests/texture/configuration-anno-0.toml");
|
||||
let content = fs::read_to_string(&path).unwrap();
|
||||
let content = fs::read_to_string(path).unwrap();
|
||||
|
||||
let qemu = QemuConfig::new();
|
||||
qemu.register();
|
||||
|
Loading…
Reference in New Issue
Block a user