Skip to content

Commit

Permalink
Avoid unnecessary allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacdonald committed Sep 19, 2024
1 parent 47d4880 commit 980f142
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,8 @@ fn set_build_revision() {
.expect("Failed to execute git command");

// Parse the hash
let build_revision = String::from_utf8(output.stdout)
.expect("Invalid UTF-8 sequence")
.trim()
.to_string();
let build_revision = String::from_utf8(output.stdout).expect("Invalid UTF-8 sequence");

// Write the hash as an environment variable
println!("cargo:rustc-env=BUILD_REVISION={}", build_revision);
println!("cargo:rustc-env=BUILD_REVISION={}", build_revision.trim());
}

0 comments on commit 980f142

Please sign in to comment.