src/bin/proxmox-backup-client.rs: refactoring of match statement

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2019-09-03 16:17:23 +02:00 committed by Dietmar Maurer
parent a40220c056
commit 3fa71727ee
1 changed files with 2 additions and 4 deletions

View File

@ -608,10 +608,8 @@ fn create_backup(
use std::os::unix::fs::FileTypeExt; use std::os::unix::fs::FileTypeExt;
let metadata = match std::fs::metadata(filename) { let metadata = std::fs::metadata(filename)
Ok(m) => m, .map_err(|err| format_err!("unable to access '{}' - {}", filename, err))?;
Err(err) => bail!("unable to access '{}' - {}", filename, err),
};
let file_type = metadata.file_type(); let file_type = metadata.file_type();
let extension = target.rsplit('.').next() let extension = target.rsplit('.').next()