Hi all,
I'm a newcomer to Rust. One of the things that I find confusing is the use
of {} in formatted strings. In all other languages I've ever used, it's
always %. So instead of writing %d, you write {:d} in Rust. Why is
this so? What benefits do we get?
Thanks,
Derek
On Mon, Nov 18, 2013 at 2:02 AM, Derek Chiang derekchian...@gmail.com wrote:
Hi all,
I'm a newcomer to Rust. One of the things that I find confusing is the use
of {} in formatted strings. In all other languages I've ever used, it's
always %. So instead of writing %d, you write {:d} in
Rust’s old fmt! syntax also used % instead of {}. The reason for the switch was
to primarily support compatibility with an internationalization-style scheme of
string formatting. The main benefit of {} of % is that you can nest {} inside
of another format, whereas with % you’re limited to just