better combinator

This commit is contained in:
Edward Shen 2021-05-22 20:19:17 -04:00
parent 7acc126de2
commit 96a6b76baa
Signed by: edward
GPG key ID: 19182661E818369F

2
src/cache/mod.rs vendored
View file

@ -233,7 +233,7 @@ impl CacheStream {
Ok(Self {
inner,
decrypt: header
.map(|header| SecretStream::init_pull(&header, ENCRYPTION_KEY.get().unwrap()))
.and_then(|header| ENCRYPTION_KEY.get().map(|key| SecretStream::init_pull(&header, key)))
.transpose()?,
})
}