Skip to content

Commit

Permalink
Don't panic if rustdoc is missing (#64)
Browse files Browse the repository at this point in the history
* don't panic if rustdoc is missing

* Use unwrap_or_default rather than unwrap_or

Ref #64 (comment)
  • Loading branch information
emilal authored Apr 9, 2024
1 parent d89b72c commit a5790d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl EnvironmentMap {
let rustdoc = &self.0["RUSTDOC"];

let rustc_version = get_version_from_cmd(rustc.as_ref())?;
let rustdoc_version = get_version_from_cmd(rustdoc.as_ref())?;
let rustdoc_version = get_version_from_cmd(rustdoc.as_ref()).unwrap_or_default();

let doc = format!("The output of `{rustc} -V`");
write_str_variable!(w, "RUSTC_VERSION", rustc_version, doc);
Expand Down

0 comments on commit a5790d4

Please sign in to comment.