Skip to content

Commit bd8fab1

Browse files
5ec1cffbackslashxx
authored andcommitted
chore: refine code
1 parent df0f057 commit bd8fab1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

userspace/ksud/src/magic_mount.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl Node {
7171

7272
if let Some(node) = node {
7373
has_file |= if let Directory = node.file_type {
74-
node.collect_module_files(&dir.join(&node.name))?
74+
node.collect_module_files(dir.join(&node.name))?
7575
} else {
7676
true
7777
}
@@ -146,7 +146,7 @@ fn collect_module_files() -> Result<Option<Node>> {
146146
}
147147

148148
if has_file {
149-
for partition in vec!["vendor", "system_ext", "product", "odm"] {
149+
for partition in ["vendor", "system_ext", "product", "odm"] {
150150
let path_of_root = Path::new("/").join(partition);
151151
let path_of_system = Path::new("/system").join(partition);
152152
if path_of_root.is_dir() && path_of_system.is_symlink() {
@@ -305,7 +305,7 @@ fn do_magic_mount<P: AsRef<Path>, WP: AsRef<Path>>(
305305
Some(Gid::from_raw(metadata.gid())),
306306
)?;
307307
}
308-
lsetfilecon(&work_dir_path, lgetfilecon(&path)?.as_str())?;
308+
lsetfilecon(&work_dir_path, lgetfilecon(path)?.as_str())?;
309309
}
310310

311311
if create_tmpfs {

userspace/ksud/src/module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ pub fn handle_updated_modules() -> Result<()> {
284284
log::error!("Failed to remove old {}: {}", old_dir.display(), e);
285285
}
286286
}
287-
if let Err(e) = rename(&module, &old_dir) {
287+
if let Err(e) = rename(module, &old_dir) {
288288
log::error!("Failed to move new module {}: {}", module.display(), e);
289289
}
290290
}

0 commit comments

Comments
 (0)