From 1749fce2b227efc446ca478891ea5f63b62f5c2d Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 20 Jan 2020 21:53:24 -0800 Subject: [PATCH] Slighly improve readability of Hasher::hash_root type: reform --- src/hasher.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/hasher.rs b/src/hasher.rs index d6aa232..bf1ae47 100644 --- a/src/hasher.rs +++ b/src/hasher.rs @@ -32,12 +32,9 @@ impl Hasher { } fn hash_root(mut self, root: &Path) -> Result<(Mode, Vec), Error> { - let single = root - .metadata() - .context(error::Filesystem { path: root })? - .is_file(); + let metadata = root.metadata().context(error::Filesystem { path: root })?; - if single { + if metadata.is_file() { let (md5sum, length) = self.hash_file(&root)?; if self.piece_bytes_hashed > 0 {