mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-24 00:00:19 +03:00
fix: keep compat with MSRV
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
This commit is contained in:
parent
d42a097280
commit
31066e17e8
@ -345,15 +345,15 @@ fn cmd_mount_inner(opt: Cli) -> Result<()> {
|
|||||||
if unsafe { bcachefs::bch2_sb_is_encrypted(first_sb.sb) } {
|
if unsafe { bcachefs::bch2_sb_is_encrypted(first_sb.sb) } {
|
||||||
let _key_handle = KeyHandle::new_from_search(&uuid).or_else(|_| {
|
let _key_handle = KeyHandle::new_from_search(&uuid).or_else(|_| {
|
||||||
opt.passphrase_file
|
opt.passphrase_file
|
||||||
.map(|path| {
|
.and_then(|path| match Passphrase::new_from_file(&first_sb, path) {
|
||||||
Passphrase::new_from_file(&first_sb, path)
|
Ok(p) => Some(KeyHandle::new(&first_sb, &p)),
|
||||||
.inspect_err(|e| {
|
Err(e) => {
|
||||||
error!(
|
error!(
|
||||||
"Failed to read passphrase from file, falling back to prompt: {}",
|
"Failed to read passphrase from file, falling back to prompt: {}",
|
||||||
e
|
e
|
||||||
)
|
);
|
||||||
})
|
None
|
||||||
.and_then(|p| KeyHandle::new(&first_sb, &p))
|
}
|
||||||
})
|
})
|
||||||
.unwrap_or_else(|| opt.unlock_policy.apply(&first_sb))
|
.unwrap_or_else(|| opt.unlock_policy.apply(&first_sb))
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user