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

Miscellaneous changes to Rust Guide #19823

Merged
merged 1 commit into from
Dec 22, 2014
Merged

Miscellaneous changes to Rust Guide #19823

merged 1 commit into from
Dec 22, 2014

Conversation

iKevinY
Copy link
Contributor

@iKevinY iKevinY commented Dec 13, 2014

I was reading through the Rust Guide (hopefully looking to learn some Rust), and I figured it would be a good idea to open a pull request with some of the errata I noticed along the way. Most of the changes are pretty mundane, but there are a couple that might raise a bit of discussion.

Punctuation outside of 'key term' quotes

This is something that was inconsistent in the Guide. While the convention in American English is to place punctuation immediately following a quotation mark inside the quotation mark, it seems strange to do this with 'key terms', considering they are not a true quotation.

Changed comment placement in 17.2 code block

This is what the code block in 17.2 — Ownership, borrowing, and lifetimes looks like in fullscreened Safari 8:

screen shot 2014-12-13 at 2 48 47 pm

Some of the comments extend just too far, causing them to bleed into the next line, so I moved a few of them above the relevant lines of code to avoid this.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pcwalton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@@ -1178,7 +1178,7 @@ fn respond(greeting: &str) -> StringResult {
```

Notice that we need both the enum name and the variant name: `StringResult::StringOK`, but
we didn't need to with `Ordering`, we just said `Greater` rather than `Ordering::Greater`.
we didn't need to with `Ordering` -- we just said `Greater` rather than `Ordering::Greater`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if this was an em dash rather than two hyphens.

@steveklabnik
Copy link
Member

it seems strange to do this with 'key terms', considering they are not a true quotation.

Hey thanks! I think this is true too, I'm not sure there's precident here for one way or the other, but I agree.

@steveklabnik
Copy link
Member

Some of the comments extend just too far,

I think this is because Rust style is 100 columns, but the style might be set up for 80...

@steveklabnik
Copy link
Member

I just reviewed the first bit of this now, and it mostly looks good! I'll review more in the morning. Thank you!

@iKevinY
Copy link
Contributor Author

iKevinY commented Dec 14, 2014

Thanks for the initial review! I agree with and have addressed the em dash changes.

Edit: I realized I used em dashes with adjacent spaces, even though the convention is to use en dashes with spaces or em dashes without spaces. Since most people who edit the document will probably be using monospaced fonts, I think en dashes with spaces would be the better option since they're more easily differentiable from hyphens at a glance.

@steveklabnik
Copy link
Member

I concur about the spaces.

@@ -4335,7 +4334,7 @@ fn twice(x: int, f: |int| -> int) -> int {
```

Since our closure is named `f`, we can call it just like we called our closures
before. And we pass in our `x` argument to each one. Hence 'twice.'
before. And we pass in our `x` argument to each one. Hence, 'twice'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't a Rust-specific concept and therefore wouldn't be part of the 'punctuation outside' convention we're talking about here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Looking back on this, it seems to make more sense to reference the name of the function using backticks.

@steveklabnik
Copy link
Member

So, ovearall, this looks good. But, we've sorta ended up with two conventions here: sometimes, with a concept, we mark it in bold, and sometimes we use single quotes.

What about moving all of these instances to italics, instead?

@iKevinY
Copy link
Contributor Author

iKevinY commented Dec 18, 2014

I was hesitant to touch too many things since I'm still really new to Rust. To clarify, would the proposed change be to take every instance of **bolded** and 'single quoted' terms in the Guide and turn them into italics? Also, I noticed that currently, _underscores_ are used to indicate italicized text; should this markup be used rather than *single asterisks*?

@steveklabnik
Copy link
Member

Since they both come out to the same thing, I don't think changing them to the single sytax is worth it. But yeah, let's change them all for now.

@iKevinY
Copy link
Contributor Author

iKevinY commented Dec 19, 2014

I decided on using the underscore syntax since that's what was already in place. Some of the instances of bold or single quotes were legitimate, so I either left them (in the case of bolded text) or changed them to double quotes.

Edit: Looks like there's merge conflicts now; I'll work on resolving them.

@iKevinY
Copy link
Contributor Author

iKevinY commented Dec 19, 2014

Actually, I'm thinking that doing the whole bold/quotes to italics change might be out of the scope of this pull request, so I got rid of that commit. I can open a new PR making the discussed changes that covers more files than just guide.md later on.

Should I squash down these three commits if everything looks good?

@steveklabnik
Copy link
Member

yes, r=me with a squash

(I think GitHub's rendering is being a bit strange, though...)

- Various grammatical changes
- Place punctuation outside of key term quotes
- Change comment placement in 17.2 code block
- Replace double hyphens with en dashes
@iKevinY
Copy link
Contributor Author

iKevinY commented Dec 19, 2014

@steveklabnik Alright, all squashed down. I'll wait for whatever changes are happening with #19897 to be merged in before working on the bold/quotes to italics change.

@steveklabnik
Copy link
Member

Sounds great. Thanks!

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 21, 2014
I was reading through the Rust Guide (hopefully looking to learn some Rust), and I figured it would be a good idea to open a pull request with some of the errata I noticed along the way. Most of the changes are pretty mundane, but there are a couple that might raise a bit of discussion.

### Punctuation outside of 'key term' quotes

This is something that was inconsistent in the Guide. While the convention in American English is to place punctuation immediately following a quotation mark *inside* the quotation mark, it seems strange to do this with 'key terms', considering they are not a true quotation.

### Changed comment placement in 17.2 code block

This is what the code block in [17.2 — Ownership, borrowing, and lifetimes](http://doc.rust-lang.org/guide.html#ownership,-borrowing,-and-lifetimes) looks like in fullscreened Safari 8:

![screen shot 2014-12-13 at 2 48 47 pm](https://cloud.githubusercontent.com/assets/2434728/5425704/2fff3bf0-82d7-11e4-8c8f-d594acde8937.png)

Some of the comments extend *just* too far, causing them to bleed into the next line, so I moved a few of them above the relevant lines of code to avoid this.
@bors bors merged commit 1919de8 into rust-lang:master Dec 22, 2014
@iKevinY iKevinY deleted the doc-fixes branch December 22, 2014 03:15
bors added a commit that referenced this pull request Jan 10, 2015
Here's my PR for the changes discussed in #19823. I decided to leave `_these_` types of italics the way there were because it differentiates the use of italics for emphasis from `*key term*` italics. Otherwise, bolded terms have been changed to italics, and single and double quotes have been changed appropriately, depending on their context (my judgement may not be the best, though).

r? @steveklabnik (congratulations on #19897 being finalized and merged, by the way!)
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