clippy: more misc fixes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
committed by
Wolfgang Bumiller
parent
367c0ff7c6
commit
4d104cd4d8
@ -315,22 +315,13 @@ fn change_passphrase(
|
||||
},
|
||||
)]
|
||||
/// Print the encryption key's metadata.
|
||||
fn show_key(
|
||||
path: Option<String>,
|
||||
param: Value,
|
||||
) -> Result<(), Error> {
|
||||
fn show_key(path: Option<String>, param: Value) -> Result<(), Error> {
|
||||
let path = match path {
|
||||
Some(path) => PathBuf::from(path),
|
||||
None => {
|
||||
let path = find_default_encryption_key()?
|
||||
.ok_or_else(|| {
|
||||
format_err!("no encryption file provided and no default file found")
|
||||
})?;
|
||||
path
|
||||
}
|
||||
None => find_default_encryption_key()?
|
||||
.ok_or_else(|| format_err!("no encryption file provided and no default file found"))?,
|
||||
};
|
||||
|
||||
|
||||
let config: KeyConfig = serde_json::from_slice(&file_get_contents(path.clone())?)?;
|
||||
|
||||
let output_format = get_output_format(¶m);
|
||||
@ -442,13 +433,8 @@ fn paper_key(
|
||||
) -> Result<(), Error> {
|
||||
let path = match path {
|
||||
Some(path) => PathBuf::from(path),
|
||||
None => {
|
||||
let path = find_default_encryption_key()?
|
||||
.ok_or_else(|| {
|
||||
format_err!("no encryption file provided and no default file found")
|
||||
})?;
|
||||
path
|
||||
}
|
||||
None => find_default_encryption_key()?
|
||||
.ok_or_else(|| format_err!("no encryption file provided and no default file found"))?,
|
||||
};
|
||||
|
||||
let data = file_get_contents(&path)?;
|
||||
|
Reference in New Issue
Block a user