add build.rs

This commit is contained in:
b1
2021-02-05 18:33:33 +08:00
parent 071fbad9d8
commit 9d5c41f335
+11
View File
@@ -0,0 +1,11 @@
fn main() {
let input = "OutputDebugStringA";
let bytes= input.as_bytes().to_owned();
let mut bytes: Vec<String> = 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);
}