Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Jul 26, 2024
1 parent f800751 commit f722062
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions userspace/ksud/src/boot_patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn parse_kmi_from_kernel(kernel: &PathBuf, workdir: &Path) -> Result<String> {
use std::fs::{copy, File};
use std::io::{BufReader, Read};
let kernel_path = workdir.join("kernel");
copy(&kernel, &kernel_path).context("Failed to copy kernel")?;
copy(kernel, &kernel_path).context("Failed to copy kernel")?;

let file = File::open(&kernel_path).context("Failed to open kernel file")?;
let mut reader = BufReader::new(file);
Expand Down Expand Up @@ -132,7 +132,7 @@ fn parse_kmi_from_kernel(kernel: &PathBuf, workdir: &Path) -> Result<String> {
fn parse_kmi_from_boot(magiskboot: &Path, image: &PathBuf, workdir: &Path) -> Result<String> {
let image_path = workdir.join("image");

std::fs::copy(&image, &image_path).context("Failed to copy image")?;
std::fs::copy(image, &image_path).context("Failed to copy image")?;

let status = Command::new(magiskboot)
.current_dir(workdir)
Expand Down Expand Up @@ -375,7 +375,7 @@ fn do_patch(
let kmi = if let Some(kmi) = kmi {
kmi
} else {
let kmi = match get_current_kmi() {
match get_current_kmi() {
Ok(value) => value,
Err(e) => {
println!("- {}", e);
Expand All @@ -395,8 +395,7 @@ fn do_patch(
"".to_string()
}
}
};
kmi
}
};

let skip_init = kmi.starts_with("android12-");
Expand Down

0 comments on commit f722062

Please sign in to comment.