diff --git a/userspace/ksud/src/module.rs b/userspace/ksud/src/module.rs index e3748775..5db58885 100644 --- a/userspace/ksud/src/module.rs +++ b/userspace/ksud/src/module.rs @@ -436,7 +436,7 @@ pub fn install_module(zip: String) -> Result<()> { setsyscon(module_update_tmp_dir)?; let result = { - let module_dir = format!("{}/{}", module_update_tmp_dir, module_id); + let module_dir = format!("{module_update_tmp_dir}/{module_id}"); ensure_clean_dir(&module_dir)?; info!("module dir: {}", module_dir); @@ -451,7 +451,7 @@ pub fn install_module(zip: String) -> Result<()> { let module_system_dir = module_system_dir.as_path(); if module_system_dir.exists() { let path = module_system_dir.to_str().unwrap(); - restore_syscon(&path)?; + restore_syscon(path)?; } exec_install_script(&zip) @@ -464,7 +464,7 @@ pub fn install_module(zip: String) -> Result<()> { let _ = remove_dir_all(module_update_tmp_dir); // return if exec script failed - result.with_context(|| format!("Failed to execute install script for {}", module_id))?; + result.with_context(|| format!("Failed to execute install script for {module_id}"))?; // all done, rename the tmp image to modules_update.img if std::fs::rename(tmp_module_img, defs::MODULE_UPDATE_IMG).is_err() { @@ -553,7 +553,7 @@ pub fn uninstall_module(id: String) -> Result<()> { } // santity check - let target_module_path = format!("{}/{}", update_dir, mid); + let target_module_path = format!("{update_dir}/{mid}"); let target_module = Path::new(&target_module_path); if target_module.exists() { remove_dir_all(target_module)?; @@ -566,7 +566,7 @@ pub fn uninstall_module(id: String) -> Result<()> { } fn do_enable_module(module_dir: &str, mid: &str, enable: bool) -> Result<()> { - let src_module_path = format!("{}/{}", module_dir, mid); + let src_module_path = format!("{module_dir}/{mid}"); let src_module = Path::new(&src_module_path); if !src_module.exists() { bail!("module: {} not found!", mid); diff --git a/userspace/ksud/src/mount.rs b/userspace/ksud/src/mount.rs index 59a8ba8f..5c5cba0c 100644 --- a/userspace/ksud/src/mount.rs +++ b/userspace/ksud/src/mount.rs @@ -43,16 +43,16 @@ pub fn mount_overlay(lowerdir: &str, mnt: &str) -> Result<()> { } #[cfg(not(target_os = "android"))] -pub fn mount_ext4(src: &str, target: &str) -> Result<()> { +pub fn mount_ext4(_src: &str, _target: &str) -> Result<()> { unimplemented!() } #[cfg(not(target_os = "android"))] -pub fn umount_dir(src: &str) -> Result<()> { +pub fn umount_dir(_src: &str) -> Result<()> { unimplemented!() } #[cfg(not(target_os = "android"))] -pub fn mount_overlay(lowerdir: &str, mnt: &str) -> Result<()> { +pub fn mount_overlay(_lowerdir: &str, _mnt: &str) -> Result<()> { unimplemented!() } diff --git a/userspace/ksud/src/sepolicy.rs b/userspace/ksud/src/sepolicy.rs index 88b6e190..eff427a8 100644 --- a/userspace/ksud/src/sepolicy.rs +++ b/userspace/ksud/src/sepolicy.rs @@ -718,7 +718,7 @@ fn apply_one_rule<'a>(statement: &'a PolicyStatement<'a>) -> Result<()> { } #[cfg(not(target_os = "android"))] -fn apply_one_rule<'a>(statement: &'a PolicyStatement<'a>) -> Result<()> { +fn apply_one_rule<'a>(_statement: &'a PolicyStatement<'a>) -> Result<()> { unimplemented!() } diff --git a/userspace/ksud/src/utils.rs b/userspace/ksud/src/utils.rs index 9b4a8766..f9bc7a02 100644 --- a/userspace/ksud/src/utils.rs +++ b/userspace/ksud/src/utils.rs @@ -66,7 +66,7 @@ pub fn getprop(prop: &str) -> Option { } #[cfg(not(target_os = "android"))] -pub fn getprop(prop: &str) -> Option { +pub fn getprop(_prop: &str) -> Option { unimplemented!() }