feat: fix clippy

This commit is contained in:
2023-10-13 08:47:38 +08:00
parent c873a52ac6
commit c9774d7542
10 changed files with 31 additions and 34 deletions

View File

@@ -113,7 +113,7 @@ fn encrypt_single(path: &PathBuf, envelops: &[&TinyEncryptConfigEnvelop], cmd_en
util::require_file_not_exists(path_out.as_str())?;
let (key, nonce) = util::make_key256_and_nonce();
let envelops = encrypt_envelops(&key, &envelops)?;
let envelops = encrypt_envelops(&key, envelops)?;
let encrypted_comment = match &cmd_encrypt.encrypted_comment {
None => None,
@@ -200,7 +200,7 @@ fn encrypt_file(file_in: &mut File, file_out: &mut File, key: &[u8], nonce: &[u8
GzStreamEncoder::new(Compression::new(*compress_level))
}
};
let mut encryptor = aes_gcm_stream::Aes256GcmStreamEncryptor::new(key, &nonce);
let mut encryptor = aes_gcm_stream::Aes256GcmStreamEncryptor::new(key, nonce);
loop {
let len = opt_result!(file_in.read(&mut buffer), "Read file failed: {}");
if len == 0 {
@@ -292,7 +292,7 @@ fn encrypt_envelop_shared_secret(key: &[u8],
header: WrapKeyHeader {
kid: None, // Some(envelop.kid.clone()),
enc: enc_type.to_string(),
e_pub_key: util::encode_base64_url_no_pad(&ephemeral_spki),
e_pub_key: util::encode_base64_url_no_pad(ephemeral_spki),
},
nonce,
encrypted_data: encrypted_key,