Skip to content

Commit f925c58

Browse files
authored
Merge pull request #2386 from acmcarther/master
Make rustfmt-bin's CARGO_PKG_VERSION envvar optional
2 parents a19e1c0 + 6d294e6 commit f925c58

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)