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

Implement Display for structs in std::char #1848

Closed
clarfonthey opened this issue Jan 7, 2017 · 1 comment
Closed

Implement Display for structs in std::char #1848

clarfonthey opened this issue Jan 7, 2017 · 1 comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the RFC.

Comments

@clarfonthey
Copy link
Contributor

clarfonthey commented Jan 7, 2017

Right now, EscapeUnicode, EscapeDefault, EscapeDebug, ToLowercase, and ToUppercase do not implement Display. I think that this would be rather useful, because then you could simplyprint!("{}", 'ß'.to_uppercase()) instead of having to do a for loop or convert to a String (which is costly).

Code is implemented in rust-lang/rust#38909.

@clarfonthey
Copy link
Contributor Author

Closing this because a pull request will suffice.

bors added a commit to rust-lang/rust that referenced this issue Jan 13, 2017
Implement Display for char Escape*, To*case.

See: rust-lang/rfcs#1848.

A good example of where this is useful would be in the example `print!("{}", 'ß'.to_uppercase())`.

Not sure if this requires a formal RFC, but I decided to write the code for it anyway regardless.
@Centril Centril added the T-libs-api Relevant to the library API team, which will review and decide on the RFC. label Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

2 participants