Skip to content

Commit 6d294e6

Browse files
committed
Make rustfmt-bin's CARGO_PKG_VERSION envvar optional
1 parent 8e6ee4a commit 6d294e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bin/rustfmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ fn print_usage_to_stdout(opts: &Options, reason: &str) {
387387
fn print_version() {
388388
println!(
389389
"{}-nightly{}",
390-
env!("CARGO_PKG_VERSION"),
390+
option_env!("CARGO_PKG_VERSION").unwrap_or("unknown"),
391391
include_str!(concat!(env!("OUT_DIR"), "/commit-info.txt"))
392392
)
393393
}

0 commit comments

Comments
 (0)