quote icon indicating copy to clipboard operation
quote copied to clipboard

How to add b prefix?

Open uuhan opened this issue 2 years ago • 0 comments

Seems b is not a valid literal prefix:

struct S {
     pub a: u32,
}

let ident = format_ident!("something");
quote! {
       match #ident {
                   b stringify!(#ident) => {} // <- b"something" => {}
                   _ => {}
       }

}

uuhan avatar Jan 28 '24 08:01 uuhan