Skip to content

Commit 5280128

Browse files
committed
[conversion/rust] Remove zero-padding from ES6-style escaping
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
1 parent 2a2d2b8 commit 5280128

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

apps/conversion/conversionfunctions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,6 @@ function convertCharStr2Rust ( str, parameters ) {
10321032
}
10331033
else {
10341034
pad = cc.toString(16).toUpperCase();
1035-
while (pad.length < 4) { pad = '0'+pad; }
10361035
outputString += '\\u{'+pad+'}'
10371036
}
10381037
}

0 commit comments

Comments
 (0)