-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Minor rewrite of char primitive unicode intro. #43919
Conversation
Opened primarily to address rust-lang#36998.
(rust_highfive has picked a reviewer for you, use r? to override) |
/// ``` | ||
/// | ||
/// This means it won't fit into a `char`. Trying to create a literal with | ||
/// `let heart = '❤️';` gives an error: | ||
/// This means that the contents of the first string above _will_ fit into a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: it's not a string technically, it's a string slice, but that might be getting too deep in the weeds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, i often use lowercase "string" to refer to text data in general, and uppercase "String" (potentially with backticks) to denote the owned-text-data type in the standard library. I don't think it's a problem here.
@bors r+ rollup Thanks! I like this example better, especially since you put in the character names in there. |
📌 Commit 1065ad4 has been approved by |
…=QuietMisdreavus Minor rewrite of char primitive unicode intro. Opened primarily to address rust-lang#36998. Despite my love for emoji, the heart example is a little confusing because both heart characters start with the same code point and there can be stark rendering differences across browsers. I also spelled out what each of the code points is in the code block, which (hopefully) sheds light why one character is one code point while the other is two. Very much open to suggestion and improvements. I'm pretty tired when I wrote this so I might wake up and realize that this is making things more confusing 😅
…eavus Minor rewrite of char primitive unicode intro. Opened primarily to address #36998. Despite my love for emoji, the heart example is a little confusing because both heart characters start with the same code point and there can be stark rendering differences across browsers. I also spelled out what each of the code points is in the code block, which (hopefully) sheds light why one character is one code point while the other is two. Very much open to suggestion and improvements. I'm pretty tired when I wrote this so I might wake up and realize that this is making things more confusing 😅
☀️ Test successful - status-appveyor, status-travis |
Opened primarily to address #36998.
Despite my love for emoji, the heart example is a little confusing because both heart characters start with the same code point and there can be stark rendering differences across browsers. I also spelled out what each of the code points is in the code block, which (hopefully) sheds light why one character is one code point while the other is two.
Very much open to suggestion and improvements. I'm pretty tired when I wrote this so I might wake up and realize that this is making things more confusing 😅