Walnut356@programming.dev to Programming Horror@programming.devEnglish · 1 year agoWhen your language doesn't allow arbitrary expressions in format stringsprogramming.devimagemessage-square1fedilinkarrow-up10arrow-down10
arrow-up10arrow-down1imageWhen your language doesn't allow arbitrary expressions in format stringsprogramming.devWalnut356@programming.dev to Programming Horror@programming.devEnglish · 1 year agomessage-square1fedilink
minus-squarenous@programming.devlinkfedilinkEnglisharrow-up1·1 year agoYou can give it variables: let foo = 4; let bar = "bar"; format!("{foo}{bar}"); If you have a format string that long with arbatary expressions putting them all raw in the format string is not going to improve much. Better to give them actual names first.
You can give it variables:
let foo = 4; let bar = "bar"; format!("{foo}{bar}");
If you have a format string that long with arbatary expressions putting them all raw in the format string is not going to improve much. Better to give them actual names first.