From 1631c54fca84347b8b8d6a757fc1fec69534dc36 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 25 Jan 2019 12:23:47 +0100 Subject: [PATCH] tools::get_hardware_address - fix FILENAME, use file_get_contents() --- src/tools.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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))