From d69b9b679d17afbea86280865e055f6d6a01fde5 Mon Sep 17 00:00:00 2001 From: Xiang Zhu Date: Tue, 24 Jan 2023 09:54:36 -0800 Subject: [PATCH] use then instead of then_some for lazy evaluation --- runtime/src/hardened_unpack.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/hardened_unpack.rs b/runtime/src/hardened_unpack.rs index cd43d5a092d14d..e016fa1cae957f 100644 --- a/runtime/src/hardened_unpack.rs +++ b/runtime/src/hardened_unpack.rs @@ -133,7 +133,7 @@ where let parts: Vec<_> = parts.map(|p| p.unwrap()).collect(); let account_filename = - (parts.len() == 2 && parts[0] == "accounts").then_some(PathBuf::from(parts[1])); + (parts.len() == 2 && parts[0] == "accounts").then(|| PathBuf::from(parts[1])); let unpack_dir = match entry_checker(parts.as_slice(), kind) { UnpackPath::Invalid => { return Err(UnpackError::Archive(format!(