summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2023-03-24 04:22:48 -0400
committerGitHub <noreply@github.com>2023-03-24 09:22:48 +0100
commitec3f7004caad7b0db72aba60fc0c9b93947f8d7c (patch)
tree4cd22b25efdd46d1cd5abf55ea1d9f9743ababd7
parent8b1852cffb9abd128da29e87598d5f37d39f4f4b (diff)
Fix index out of bounds error in build script (#173)
-rw-r--r--cli/build.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/build.rs b/cli/build.rs
index 7c1e1dc8..06d4b0b0 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}");
}