From 65cd08b9b75e18fc384632a0b86abca3d7a7a1f3 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 7 Nov 2014 20:01:15 +0000 Subject: [PATCH] ES6-style escaping: add drawback: overriding {} with format! --- text/0000-es6-unicode-escapes.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/text/0000-es6-unicode-escapes.md b/text/0000-es6-unicode-escapes.md index d429cd47803..7c1f60ca9fa 100644 --- a/text/0000-es6-unicode-escapes.md +++ b/text/0000-es6-unicode-escapes.md @@ -46,8 +46,15 @@ The behavior would otherwise be identical. # Drawbacks -This is a breaking change and updating code for it manually is annoying. -It is however very mechanical, and we could provide scripts to automate it. +* This is a breaking change and updating code for it manually is annoying. + It is however very mechanical, and we could provide scripts to automate it. +* Formatting templates already use curly braces. + Having multiple curly braces pairs in the same strings that have a very + different meaning can be surprising: + `format!("\u{e8}_{e8}", e8 = "é")` is `"è_é"`. + However, there is a precedent of overriding characters: + `\` can start an escape sequence both in the Rust lexer for strings + and in regular expressions. # Alternatives