feat: migrate tauri 2.0

This commit is contained in:
huzibaca
2024-09-04 08:54:15 +08:00
parent c07165531a
commit 07de032e62
22 changed files with 842 additions and 14750 deletions

View File

@@ -6,7 +6,6 @@ use serde_yaml::{Mapping, Value};
use std::{fs, path::PathBuf, str::FromStr};
use tauri_plugin_shell::ShellExt;
/// read data from yaml as struct T
pub fn read_yaml<T: DeserializeOwned>(path: &PathBuf) -> Result<T> {
if !path.exists() {
@@ -160,6 +159,17 @@ macro_rules! ret_err {
};
}
#[macro_export]
macro_rules! t {
($en:expr, $zh:expr, $use_zh:expr) => {
if $use_zh {
$zh
} else {
$en
}
};
}
#[test]
fn test_parse_value() {
let test_1 = "upload=111; download=2222; total=3333; expire=444";