From 52801284db177d50c47a228425c2bcca7361fa12 Mon Sep 17 00:00:00 2001 From: Behnam Esfahbod Date: Tue, 25 Apr 2017 12:27:35 -0500 Subject: [PATCH] [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 * https://github.com/rust-lang/rfcs/pull/446 * https://github.com/rust-lang/rust/issues/19739 --- apps/conversion/conversionfunctions.js | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/conversion/conversionfunctions.js b/apps/conversion/conversionfunctions.js index 57db88c93..62ff0dfb1 100755 --- a/apps/conversion/conversionfunctions.js +++ b/apps/conversion/conversionfunctions.js @@ -1032,7 +1032,6 @@ function convertCharStr2Rust ( str, parameters ) { } else { pad = cc.toString(16).toUpperCase(); - while (pad.length < 4) { pad = '0'+pad; } outputString += '\\u{'+pad+'}' } }