src/bin/proxmox-backup-client.rs: refactoring of match statement
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
parent
a40220c056
commit
3fa71727ee
@ -608,10 +608,8 @@ fn create_backup(
|
||||
|
||||
use std::os::unix::fs::FileTypeExt;
|
||||
|
||||
let metadata = match std::fs::metadata(filename) {
|
||||
Ok(m) => m,
|
||||
Err(err) => bail!("unable to access '{}' - {}", filename, err),
|
||||
};
|
||||
let metadata = std::fs::metadata(filename)
|
||||
.map_err(|err| format_err!("unable to access '{}' - {}", filename, err))?;
|
||||
let file_type = metadata.file_type();
|
||||
|
||||
let extension = target.rsplit('.').next()
|
||||
|
Loading…
Reference in New Issue
Block a user