feat: updates

This commit is contained in:
2023-09-29 21:05:07 +08:00
parent 15ffcb9c60
commit 86c0ed7230
6 changed files with 126 additions and 28 deletions

View File

@@ -1,10 +1,10 @@
use std::{fs, io};
use std::io::Write;
use std::path::{Path, PathBuf};
use std::path::Path;
use base64::Engine;
use base64::engine::general_purpose;
use rust_util::{opt_result, simple_error, warning, XResult};
use rust_util::{simple_error, warning, XResult};
use zeroize::Zeroize;
pub const ENC_AES256_GCM_P256: &str = "aes256-gcm-p256";
@@ -25,7 +25,7 @@ pub fn require_file_exists(path: impl AsRef<Path>) -> XResult<()> {
let path = path.as_ref();
match fs::metadata(path) {
Ok(_) => Ok(()),
Err(e) => simple_error!("File: {} not exists", path.display()),
Err(_) => simple_error!("File: {} not exists", path.display()),
}
}