From c8dd0b070ccc2ef00791b3631243aeb73c1221ac Mon Sep 17 00:00:00 2001 From: weishu Date: Wed, 24 Apr 2024 21:36:38 +0800 Subject: [PATCH] ksud: Fix compiler error --- userspace/ksud/src/boot_patch.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/userspace/ksud/src/boot_patch.rs b/userspace/ksud/src/boot_patch.rs index 4ed3db82..b518de09 100644 --- a/userspace/ksud/src/boot_patch.rs +++ b/userspace/ksud/src/boot_patch.rs @@ -436,9 +436,11 @@ fn do_patch( } #[cfg(target_os = "android")] -fn calculate_sha1(file_path: impl AsRef) -> io::Result { - let mut file = File::open(file_path.as_ref())?; - let mut hasher = Sha1::new(); +fn calculate_sha1(file_path: impl AsRef) -> Result { + use sha1::Digest; + use std::io::Read; + let mut file = std::fs::File::open(file_path.as_ref())?; + let mut hasher = sha1::Sha1::new(); let mut buffer = [0; 1024]; loop {