Slighly improve readability of Hasher::hash_root
type: reform
This commit is contained in:
parent
1f5b829742
commit
1749fce2b2
|
@ -32,12 +32,9 @@ impl Hasher {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn hash_root(mut self, root: &Path) -> Result<(Mode, Vec<u8>), Error> {
|
fn hash_root(mut self, root: &Path) -> Result<(Mode, Vec<u8>), Error> {
|
||||||
let single = root
|
let metadata = root.metadata().context(error::Filesystem { path: root })?;
|
||||||
.metadata()
|
|
||||||
.context(error::Filesystem { path: root })?
|
|
||||||
.is_file();
|
|
||||||
|
|
||||||
if single {
|
if metadata.is_file() {
|
||||||
let (md5sum, length) = self.hash_file(&root)?;
|
let (md5sum, length) = self.hash_file(&root)?;
|
||||||
|
|
||||||
if self.piece_bytes_hashed > 0 {
|
if self.piece_bytes_hashed > 0 {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user