From a5790d473eb564aa7127ffa61196e4756143867d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Snorre=20Aln=C3=A6s?= Date: Tue, 9 Apr 2024 12:16:33 +0200 Subject: [PATCH] Don't panic if rustdoc is missing (#64) * don't panic if rustdoc is missing * Use unwrap_or_default rather than unwrap_or Ref https://github.com/lukaslueg/built/pull/64#issuecomment-2043593720 --- src/environment.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/environment.rs b/src/environment.rs index 2d68c1942..c257e08a0 100644 --- a/src/environment.rs +++ b/src/environment.rs @@ -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);