feat: optimize info

This commit is contained in:
2023-12-10 14:31:21 +08:00
parent fd98c27462
commit e7a9877cad

View File

@@ -121,11 +121,8 @@ pub fn info_single(path: &PathBuf, cmd_info: &CmdInfo, config: &Option<TinyEncry
}
infos.push(format!("{}: {}", header("Encrypted comment"), to_yes_or_no(&meta.encrypted_comment)));
infos.push(format!("{}: {}", header("Encrypted meta"), to_yes_or_no(&meta.encrypted_meta)));
let encryption_algorithm = if let Some(encryption_algorithm) = &meta.encryption_algorithm {
encryption_algorithm.to_string()
} else {
format!("{} (default)", TINY_ENC_AES_GCM)
};
let encryption_algorithm = meta.encryption_algorithm.clone()
.unwrap_or_else(|| format!("{} (default)", TINY_ENC_AES_GCM));
infos.push(format!("{}: {}", header("Encryption algorithm"), encryption_algorithm));
success!("{}", infos.join("\n"));