summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Mühlbacher <tmuehlbacher@posteo.net>2024-05-31 02:27:43 +0200
committerThomas Mühlbacher <tmuehlbacher@posteo.net>2024-05-31 02:30:59 +0200
commit31066e17e843b10e4abeb983ae4c8cc0279591d4 (patch)
treeb20828312f59c8afb44aee6905f7dce7ae87a8a4 /src
parentd42a09728051e3b3611fde927adf37c84589921c (diff)
fix: keep compat with MSRV
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
Diffstat (limited to 'src')
-rw-r--r--src/commands/mount.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/commands/mount.rs b/src/commands/mount.rs
index 49849aae..622f6cb9 100644
--- a/src/commands/mount.rs
+++ b/src/commands/mount.rs
@@ -345,15 +345,15 @@ fn cmd_mount_inner(opt: Cli) -> Result<()> {
if unsafe { bcachefs::bch2_sb_is_encrypted(first_sb.sb) } {
let _key_handle = KeyHandle::new_from_search(&uuid).or_else(|_| {
opt.passphrase_file
- .map(|path| {
- Passphrase::new_from_file(&first_sb, path)
- .inspect_err(|e| {
- error!(
- "Failed to read passphrase from file, falling back to prompt: {}",
- e
- )
- })
- .and_then(|p| KeyHandle::new(&first_sb, &p))
+ .and_then(|path| match Passphrase::new_from_file(&first_sb, path) {
+ Ok(p) => Some(KeyHandle::new(&first_sb, &p)),
+ Err(e) => {
+ error!(
+ "Failed to read passphrase from file, falling back to prompt: {}",
+ e
+ );
+ None
+ }
})
.unwrap_or_else(|| opt.unlock_policy.apply(&first_sb))
});