From 9d5c41f3359ae77081896e9c1c377da6100386d1 Mon Sep 17 00:00:00 2001 From: b1 Date: Fri, 5 Feb 2021 18:33:33 +0800 Subject: [PATCH] add build.rs --- build.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 build.rs diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..5ffe96e --- /dev/null +++ b/build.rs @@ -0,0 +1,11 @@ +fn main() { + let input = "OutputDebugStringA"; + let bytes= input.as_bytes().to_owned(); + let mut bytes: Vec = bytes.into_iter().map(|a:u8| format!("{}", a)).collect(); + bytes.push("0".to_owned()); + let bb = bytes.join(", "); + dbg!(&bb); + let input_up = input.to_uppercase(); + let res = format!("const {} :&[u16] = [{}];", input_up, &bb); + dbg!(res); +} \ No newline at end of file