- VERSION
- CARGO_PKG_VERSION
Take version number from Cargo.toml
examples/other/version-number/src/main.rs
const VERSION: &str = env!("CARGO_PKG_VERSION"); fn main() { println!("Running version {VERSION}"); }
const VERSION: &str = env!("CARGO_PKG_VERSION"); fn main() { println!("Running version {VERSION}"); }