udoprog/genco

Interpolate string variable without quotes

danielblignaut opened this issue · 3 comments

Hi,

Is there a way to render the contents of a rust variables (which is a String type) but without the surrounding quotes? Similar to if I just had

quote! {
raw_value
}

would output: raw_value
...
I'm looking for

let custom_variable: String = "raw_value"
quote! {
#custom_variable
}

would also output: raw_value where

I've tried all sort of String to static string conversions, attempted implementing my own language but just can't get it to work.

Interpolation in genco is done with $ since #27, so try $custom_variable!

Hi @udoprog ,

So I have the interpolation working in both v16 and v17 (changing # for $). But the interpolated string has quotes generated around it when it's outputted. I am trying to avoid the quotes being added. Is this possible?

Hm, so I'm not following. This works for me: 885f5ba

What exactly are you doing?