diff --git a/src/tools.rs b/src/tools.rs index a706d84c..81747e64 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -387,12 +387,9 @@ pub fn scandir( pub fn get_hardware_address() -> Result { - static FILENAME: &str = "/etc/ssh/assh_host_rsa_key.pub"; - - let mut file = File::open(FILENAME)?; - let mut contents = Vec::new(); - file.read_to_end(&mut contents)?; + static FILENAME: &str = "/etc/ssh/ssh_host_rsa_key.pub"; + let contents = file_get_contents(FILENAME)?; let digest = md5::compute(contents); Ok(format!("{:0x}", digest))