mirror of https://github.com/zkat/cacache-rs.git
refactor(get): reuse open_hash
This commit is contained in:
parent
0349d115f4
commit
aee271186a
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue