feat: update info
This commit is contained in:
26
src/util.rs
Normal file
26
src/util.rs
Normal 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!");
|
||||
}
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user