From f65ded2cb49771c1af71cad8515c9f3ebd92b0c7 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 6 Mar 2024 18:16:09 -0800 Subject: [PATCH] raw bytes instead of str --- packages/interpreter/build.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/interpreter/build.rs b/packages/interpreter/build.rs index 5ca0f26d4..992a6779d 100644 --- a/packages/interpreter/build.rs +++ b/packages/interpreter/build.rs @@ -28,19 +28,19 @@ fn main() { fn hash_ts_files() -> u128 { let mut out = 0; - let files = [ - include_str!("src/ts/common.ts"), - include_str!("src/ts/native.ts"), - include_str!("src/ts/core.ts"), + let files: &[&[u8]] = &[ + include_bytes!("src/ts/common.ts"), + include_bytes!("src/ts/native.ts"), + include_bytes!("src/ts/core.ts"), ]; // Let's make the dumbest hasher by summing the bytes of the files // The location is multiplied by the byte value to make sure that the order of the bytes matters let mut idx = 0; for file in files { - for byte in file.bytes() { + for byte in file.iter() { idx += 1; - out += (byte as u128) * (idx as u128); + out += (*byte as u128) * (idx as u128); } } out