Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
DrMeepster
· 4y ago · 0 comments
This can never happen with regular string literals. String literals have the type `&'static str` but formatting returns a `String`.
Comments
[–]
pornel
4y ago
Perhaps something could be done with compile-time code execution, but the bigger problem is that it wouldn't be backwards-compatible. Currently "{foo}" is a perfectly valid string that doesn't evaluate anything.
[–]
hajile
4y ago
In truth, it probably requires something like `f"foo {bar}"`