feat: code style

This commit is contained in:
2023-12-23 16:25:26 +08:00
parent d19c9a48f1
commit 0c5dbc7cc3
3 changed files with 7 additions and 10 deletions

View File

@@ -48,9 +48,6 @@ use crate::wrap_key::WrapKey;
#[derive(Debug, Args)]
pub struct CmdDecrypt {
/// Files need to be decrypted
pub paths: Vec<PathBuf>,
/// PGP or PIV PIN
#[arg(long, short = 'p')]
pub pin: Option<String>,
@@ -94,6 +91,9 @@ pub struct CmdDecrypt {
/// Digest algorithm (sha1, sha256[default], sha384, sha512 ...)
#[arg(long, short = 'A')]
pub digest_algorithm: Option<String>,
/// Files need to be decrypted
pub paths: Vec<PathBuf>,
}
impl Drop for CmdDecrypt {

View File

@@ -34,9 +34,6 @@ use crate::wrap_key::{WrapKey, WrapKeyHeader};
#[derive(Debug, Args)]
pub struct CmdEncrypt {
/// Files need to be decrypted
pub paths: Vec<PathBuf>,
/// Plaintext comment
#[arg(long, short = 'c')]
pub comment: Option<String>,
@@ -76,6 +73,9 @@ pub struct CmdEncrypt {
/// Encryption algorithm (AES/GCM, CHACHA20/POLY1305 or AES, CHACHA20, default AES/GCM)
#[arg(long, short = 'A')]
pub encryption_algorithm: Option<String>,
/// Files need to be decrypted
pub paths: Vec<PathBuf>,
}
pub fn encrypt(cmd_encrypt: CmdEncrypt) -> XResult<()> {

View File

@@ -176,10 +176,7 @@ pub fn read_number(hint: &str, from: usize, to: usize) -> usize {
}
pub fn get_user_agent() -> String {
format!("TinyEncrypt-rs v{}@{}-{}",
env!("CARGO_PKG_VERSION"),
get_os(), get_arch(),
)
format!("TinyEncrypt-rs v{}@{}-{}", env!("CARGO_PKG_VERSION"), get_os(), get_arch())
}
pub fn get_os() -> String {