Horje
rust get crate version Code Example
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"));




19


Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11