summaryrefslogtreecommitdiff
path: root/cli/build.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-03-23 23:27:58 +0100
committerGitHub <noreply@github.com>2023-03-23 23:27:58 +0100
commit275dee60e71225a9c6c4b3b4ea7ffe4c6ecb4d87 (patch)
tree13ed3ab7e825a81085e8dcc5efeee417416b86cf /cli/build.rs
parentedab8f2fd48efddc19eb0032955fee4b5dbf76e6 (diff)
refactor: make version and user_agent &'static str (#18400)
These caused a bunch of unnecessary allocations on each startup.
Diffstat (limited to 'cli/build.rs')
-rw-r--r--cli/build.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/build.rs b/cli/build.rs
index a4f8ee92d..bcf5a0a38 100644
--- a/cli/build.rs
+++ b/cli/build.rs
@@ -459,6 +459,10 @@ fn main() {
println!("cargo:rustc-env=GIT_COMMIT_HASH={}", git_commit_hash());
println!("cargo:rerun-if-env-changed=GIT_COMMIT_HASH");
+ println!(
+ "cargo:rustc-env=GIT_COMMIT_HASH_SHORT={}",
+ &git_commit_hash()[..7]
+ );
let ts_version = ts::version();
debug_assert_eq!(ts_version, "5.0.2"); // bump this assertion when it changes