Skip to content

Commit

Permalink
[conversion/rust] Remove zero-padding from ES6-style escaping
Browse files Browse the repository at this point in the history
In Rust, it's recommended to use short (non-zero-padded) code-points
inside ES6-style escaping sequences (`\u{...}`), as it reduces the
length of the literal, and works better on the eyes for average use
cases, while mechanical parsing remains still fairly easy.

See examples in the Rust RFC and related discussion:
* https://github.com/rust-lang/rfcs/blob/master/text/0446-es6-unicode-escapes.md
* rust-lang/rfcs#446
* rust-lang/rust#19739
  • Loading branch information
behnam committed Apr 25, 2017
1 parent 2a2d2b8 commit 5280128
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion apps/conversion/conversionfunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,6 @@ function convertCharStr2Rust ( str, parameters ) {
}
else {
pad = cc.toString(16).toUpperCase();
while (pad.length < 4) { pad = '0'+pad; }
outputString += '\\u{'+pad+'}'
}
}
Expand Down

0 comments on commit 5280128

Please sign in to comment.