roc
roc copied to clipboard
Match branch pattern guards are not parsed
match value {
x if x > 0 => "positive: ${x.to_str()}",
x if x < 0 => "negative: ${x.to_str()}",
_ => "other",
}
Note the string interpolation here should be ${Num.to_str(x)} or maybe ${x.to_str()}
I copied it from an old example. Good catch.