From ec3f7004caad7b0db72aba60fc0c9b93947f8d7c Mon Sep 17 00:00:00 2001 From: figsoda Date: Fri, 24 Mar 2023 04:22:48 -0400 Subject: [PATCH] Fix index out of bounds error in build script (#173) --- cli/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/build.rs b/cli/build.rs index 7c1e1dc8f..06d4b0b08 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -6,7 +6,7 @@ fn main() { .output() .ok() .and_then(|output| output.status.success().then(|| output)) - .and_then(|output| String::from_utf8(output.stdout[..8].into()).ok()) + .and_then(|output| String::from_utf8(output.stdout.get(..8)?.into()).ok()) .unwrap_or_else(|| "(unknown version)".into()); println!("cargo:rustc-env=TYPST_VERSION={version}"); }