Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[conversion/rust] Remove zero-padding from ES6-style escaping #17

Closed
wants to merge 1 commit into from

Conversation

behnam
Copy link
Contributor

@behnam behnam commented Apr 25, 2017

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:

In action:
screen shot 2017-04-25 at 12 25 53 pm

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
@r12a
Copy link
Owner

r12a commented Apr 26, 2017

@hsivonen support for rust-style escapes was a request from you. Are you happy to make this change?

@hsivonen
Copy link

I guess I don't care particularly strongly either way, but I note that I don't see the referenced URLs supporting the assertion that omitting the leading zeros is recommended. (I see only one mention of the syntax making the omission of leading zeros possible.)

@behnam
Copy link
Contributor Author

behnam commented Apr 26, 2017

Right, @hsivonen, there's no clear indication anywhere, but a common pattern I've noticed while dealing with the code.

@behnam
Copy link
Contributor Author

behnam commented Jun 21, 2017

Let's close this. The patch is here if there's any interest.

@behnam behnam closed this Jun 21, 2017
@r12a
Copy link
Owner

r12a commented Jun 22, 2017

Done at https://r12a.github.io/app-conversion/. I will shortly redirect users to that location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants