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

Minor rewrite of char primitive unicode intro. #43919

Merged
merged 1 commit into from
Aug 19, 2017

Conversation

frewsxcv
Copy link
Member

@frewsxcv frewsxcv commented Aug 17, 2017

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 😅

@frewsxcv
Copy link
Member Author

r? @QuietMisdreavus

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(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
Copy link
Member Author

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

Copy link
Member

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.

@QuietMisdreavus
Copy link
Member

@bors r+ rollup

Thanks! I like this example better, especially since you put in the character names in there.

@bors
Copy link
Contributor

bors commented Aug 17, 2017

📌 Commit 1065ad4 has been approved by QuietMisdreavus

aidanhs added a commit to aidanhs/rust that referenced this pull request Aug 18, 2017
…=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 😅
bors added a commit that referenced this pull request Aug 18, 2017
Rollup of 4 pull requests

- Successful merges: #43919, #43936, #43950, #43978
- Failed merges:
@bors
Copy link
Contributor

bors commented Aug 19, 2017

⌛ Testing commit 1065ad4 with merge 7f397bd...

bors added a commit that referenced this pull request Aug 19, 2017
…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 😅
@bors
Copy link
Contributor

bors commented Aug 19, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: QuietMisdreavus
Pushing 7f397bd to master...

@bors bors merged commit 1065ad4 into rust-lang:master Aug 19, 2017
@frewsxcv frewsxcv deleted the frewsxcv-char-primitive branch August 19, 2017 21:15
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.

5 participants