interpolate icon indicating copy to clipboard operation
interpolate copied to clipboard

Experimenting with prefixing string literals

Open anowell opened this issue 2 years ago • 1 comments

Experimental.

use interpolate::fstring;

#[fstring]
fn foo() {
    let name = "Hercules";
    let greet = f"Hello, {name}";
}

Rendered README

anowell avatar Feb 22 '23 11:02 anowell

Fwiw, this won't compose well with other macros taking format strings.

println!("Hello {name}");

// vs.

println!(f"Hello {name}");
// which becomes
println!(format!("Hello {name}");
// Error: println! needs format string as first arg

anowell avatar Feb 22 '23 11:02 anowell