We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef05a2d commit c1fa467Copy full SHA for c1fa467
rustfmt-bin/src/main.rs
@@ -386,14 +386,14 @@ fn print_usage_to_stdout(opts: &Options, reason: &str) {
386
}
387
388
fn print_version() {
389
- println!(
390
- "rustfmt {}",
391
- concat!(
392
- env!("CARGO_PKG_VERSION"),
393
- "-",
394
- include_str!(concat!(env!("OUT_DIR"), "/commit-info.txt"))
395
- )
+ let version_info = format!(
+ "{}{}{}",
+ option_env!("CARGO_PKG_VERSION").unwrap_or("unknown"),
+ "-",
+ include_str!(concat!(env!("OUT_DIR"), "/commit-info.txt"))
396
);
+
+ println!("rustfmt {}", version_info);
397
398
399
fn determine_operation(matches: &Matches) -> FmtResult<Operation> {
0 commit comments