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.  Why is
> this so?  What benefits do we get?
>
> Thanks,
> Derek

It's the syntax used by C# and modern Python:

http://msdn.microsoft.com/en-us/library/system.string.format(v=vs.110).aspx
http://docs.python.org/2/library/string.html#format-string-syntax
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to