feat: add version function to the client.

This commit is contained in:
cschen 2024-09-19 19:32:35 +02:00 committed by alemi.dev
parent 799123c681
commit 80219f2cce

View file

@ -203,4 +203,13 @@ impl Client {
pub fn user(&self) -> &User { pub fn user(&self) -> &User {
&self.0.user &self.0.user
} }
/// Get the current version of the client
pub fn version() -> String {
let version = env!("CARGO_PKG_VERSION");
let name = env!("CARGO_PKG_NAME");
let license = env!("CARGO_PKG_LICENSE");
format!("{name} - {version} ({license})")
}
} }