From 96a6b76baa9a47e3dc8c87a752935a810faa4949 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Sat, 22 May 2021 20:19:17 -0400 Subject: [PATCH] better combinator --- src/cache/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cache/mod.rs b/src/cache/mod.rs index 39846f9..e52298e 100644 --- a/src/cache/mod.rs +++ b/src/cache/mod.rs @@ -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()?, }) }