Last active
September 29, 2020 08:46
-
-
Save heiwa4126/afc751595eada0e090b21fa084425d43 to your computer and use it in GitHub Desktop.
RustでCargo.tomlに書いた名前やバージョンを表示する方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
const VERSION: &'static str = env!("CARGO_PKG_VERSION"); | |
const PKGNAME: &'static str = env!("CARGO_PKG_NAME"); | |
println!("{} v{}", PKGNAME, VERSION); | |
// println!("{} v{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")); | |
// でもOK | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
参考リンク