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}");
}