1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#[macro_use]
extern crate proc_macro_hack;

proc_macro_expr_impl! {
    pub fn noprefix_hex_u8(input: &str) -> String {
        format!("0x{}u8", input)
    }

    pub fn noprefix_hex_u16(input: &str) -> String {
        format!("0x{}u16", input)
    }

    pub fn noprefix_hex_u32(input: &str) -> String {
        format!("0x{}u32", input)
    }

    pub fn noprefix_hex_u64(input: &str) -> String {
        format!("0x{}u64", input)
    }
}