Skip to content

[Feature Request] A crabtime::escape_string macro which quotes the string #37

Description

@meghprkh

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"##;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions