Skip to content

Minor rewrite of char primitive unicode intro. - #43919

Merged
bors merged 1 commit into
rust-lang:masterfrom
frewsxcv:frewsxcv-char-primitive
Aug 19, 2017
Merged

Minor rewrite of char primitive unicode intro.#43919
bors merged 1 commit into
rust-lang:masterfrom
frewsxcv:frewsxcv-char-primitive

Conversation

@frewsxcv

@frewsxcvfrewsxcv commented Aug 17, 2017

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

r? @QuietMisdreavus

@rust-highfive

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@bors r+ rollup

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

@bors

bors commented Aug 17, 2017

Copy link
Copy Markdown
Collaborator

📌 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 😅
@aidanhsaidanhs mentioned this pull request Aug 18, 2017
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

bors commented Aug 19, 2017

Copy link
Copy Markdown
Collaborator

⌛ 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

bors commented Aug 19, 2017

Copy link
Copy Markdown
Collaborator

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

@bors
bors merged commit 1065ad4 into rust-lang:masterAug 19, 2017
@frewsxcv
frewsxcv deleted the frewsxcv-char-primitive branch August 19, 2017 21:15
Sign up for freeto 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

@frewsxcv@rust-highfive@QuietMisdreavus@bors@alexcrichton