Skip to content

Commit

Permalink
Add functions for tox crate version information
Browse files Browse the repository at this point in the history
  • Loading branch information
antis81 committed Nov 23, 2023
1 parent 5ab95a6 commit c697b55
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tox/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,16 @@ pub use tox_core as core;
pub use tox_crypto as crypto;
pub use tox_encryptsave as encryptsave;
pub use tox_packet as packet;

pub fn crate_version() -> String {
env!("CARGO_PKG_VERSION").to_string()
}
pub fn crate_version_major() -> u32 {
env!("CARGO_PKG_VERSION_MAJOR").parse().expect("Invalid major version")
}
pub fn crate_version_minor() -> u32 {
env!("CARGO_PKG_VERSION_MINOR").parse().expect("Invalid minor version")
}
pub fn crate_version_patch() -> u32 {
env!("CARGO_PKG_VERSION_PATCH").parse().expect("Invalid patch version")
}

0 comments on commit c697b55

Please sign in to comment.