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}"); }