Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

rust get crate version

const VERSION: &'static str = env!("CARGO_PKG_VERSION");
const OPTION_VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION");

// ...

println!("MyProgram v{}", VERSION);
println!("MyProgram v{}", OPTION_VERSION.unwrap_or("unknown"));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rust #crate #version
ADD COMMENT
Topic
Name
3+2 =