refactor(get): reuse open_hash

This commit is contained in:
Kat Marchán 2019-06-30 20:12:31 -07:00
parent 0349d115f4
commit aee271186a
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
1 changed files with 1 additions and 2 deletions

View File

@ -29,8 +29,7 @@ where
K: AsRef<str>, K: AsRef<str>,
{ {
if let Some(entry) = index::find(cache.as_ref(), key.as_ref())? { if let Some(entry) = index::find(cache.as_ref(), key.as_ref())? {
let reader = read::open(cache.as_ref(), entry.integrity)?; open_hash(cache, entry.integrity)
Ok(Get { reader })
} else { } else {
Err(Error::NotFound) Err(Error::NotFound)
} }