Escaping strings is somewhat painful and needs to happen out of the macro output body. It would be nice if we can make it easier with a crabtime::escape_string macro
Usage:
#[crabtime::expression]
#[macro_export]
pub fn identity_string(icon_name: String) -> String {
crabtime::output! {
crabtime::escape_string!(icon_name)
}
}
let a = identity_string!("A#\"b");
// should generate
let a = r##"A#"b"##;
Escaping strings is somewhat painful and needs to happen out of the macro output body. It would be nice if we can make it easier with a
crabtime::escape_stringmacroUsage: