feat: update info

This commit is contained in:
2023-09-06 00:34:26 +08:00
parent d1d5c166de
commit d96ebdd5ba
6 changed files with 80 additions and 57 deletions

26
src/util.rs Normal file
View File

@@ -0,0 +1,26 @@
pub fn get_user_agent() -> String {
format!("TinyEncrypt-rs v{}@{}", env!("CARGO_PKG_VERSION"),
if cfg!(target_os = "macos") {
"MacOS"
} else if cfg!(target_os = "ios") {
"iOS"
} else if cfg!(target_os = "android") {
"Android"
} else if cfg!(target_os = "windows") {
"Windows"
} else if cfg!(target_os = "linux") {
"Linux"
} else if cfg!(target_os = "freebsd") {
"FreeBSD"
} else if cfg!(target_os = "dragonfly") {
"Dragonfly"
} else if cfg!(target_os = "openbsd") {
"OpenBSD"
} else if cfg!(target_os = "netbsd") {
"NetBSD"
} else {
panic!("Unsupported OS!");
}
)
}