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

Fix typo in ch5.3 and in CONTRIBUTING.md #4216

Merged
merged 3 commits into from
Feb 1, 2025

Conversation

PedroChaps
Copy link
Contributor

No description provided.

Copy link
Contributor

@chriskrycho chriskrycho left a comment

Choose a reason for hiding this comment

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

The update to CONTRIBUTING is correct and I’m happy to merge it, but the update to the text in chapter 5 is incorrect, so please drop that!

@@ -38,7 +38,7 @@ The `&self` is actually short for `self: &Self`. Within an `impl` block, the
type `Self` is an alias for the type that the `impl` block is for. Methods must
have a parameter named `self` of type `Self` for their first parameter, so Rust
lets you abbreviate this with only the name `self` in the first parameter spot.
Note that we still need to use the `&` in front of the `self` shorthand to
Note that we still need to use the `&` behind the `self` shorthand to
Copy link
Contributor

Choose a reason for hiding this comment

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

This is correct: it’s &self, not self: &!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Chris!

Can you please double check this?

From my understanding, the sentence I changed refers to this first sentence:
image

The sentences in between thoroughly explain how &self works under the hood, but it hints we'll never use self: &Self (only just &self), so that's why I assumed the sentence referenced to just &self.

Please lmk the intended meaning so that I can maybe change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

You’re corect that the sentence does refer to just &self; that’s exactly what “use the & i front of the self short hand” is saying. 😄 The & is “in front of” self here. There’s no need to change the sentence or its meaning; it’s already correct!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, thanks for clarifying! I've dropped that change.

Very have to contribute :)

This reverts commit ed3d672.
Copy link
Contributor

@chriskrycho chriskrycho left a comment

Choose a reason for hiding this comment

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

Thanks!

@chriskrycho chriskrycho merged commit c632570 into rust-lang:main Feb 1, 2025
3 checks passed
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 3, 2025
Update books

## rust-lang/book

2 commits in fa312a343fbff01bc6cef393e326817f70719813..e2fa4316c5a7c0d2499c5d6b799adcfad6ef7a45
2025-02-03 15:02:07 UTC to 2025-02-01 17:33:39 UTC

- Add missing word in ch17-04-streams.md (rust-lang/book#4218)
- Fix typo in ch5.3 and in CONTRIBUTING.md (rust-lang/book#4216)

## rust-lang/edition-guide

2 commits in 4ed5a1a4a2a7ecc2e529a5baaef04f7bc7917eda..f56aecc3b036dff16404b525a83b00f911b9bbea
2025-02-03 17:14:16 UTC to 2025-01-31 17:44:00 UTC

- Rustc{En,De}codable has been removed (rust-lang/edition-guide#353)
- Remove rustfmt-overflow-delimited-expr (rust-lang/edition-guide#357)

## rust-lang/nomicon

3 commits in bc2298865544695c63454fc1f9f98a3dc22e9948..336f75835a6c0514852cc65aba9a698b699b13c8
2025-02-02 10:06:30 UTC to 2025-02-02 08:35:20 UTC

- Improve grammar in exotic-sizes (rust-lang/nomicon#452)
- other-reprs: Add details for n!=1 repr(packed) (rust-lang/nomicon#460)
- Use `()` instead of `[u8; 0]` in opaque type (rust-lang/nomicon#456)

## rust-lang/reference

3 commits in 93b921c7d3213d38d920f7f905a3bec093d2217d..4249fb411dd27f945e2881eb0378044b94cee06f
2025-01-31 03:43:07 UTC to 2025-01-29 04:17:34 UTC

- Add Spec Identifier Syntax to expressions.md and subchapters (rust-lang/reference#1591)
- Exclude the test summary from the search index (rust-lang/reference#1723)
- Spec inline assembly tests (rust-lang/reference#1648)

## rust-lang/rust-by-example

1 commits in 054259ed1bf01cdee4309ee764c7e103f6df3de5..743766929f1e53e72fab74394ae259bbfb4a7619
2025-02-02 19:53:31 UTC to 2025-02-02 19:53:31 UTC

- Spanish translation to 1:2100 (rust-lang/rust-by-example#1910)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 3, 2025
Update books

## rust-lang/book

2 commits in fa312a343fbff01bc6cef393e326817f70719813..e2fa4316c5a7c0d2499c5d6b799adcfad6ef7a45
2025-02-03 15:02:07 UTC to 2025-02-01 17:33:39 UTC

- Add missing word in ch17-04-streams.md (rust-lang/book#4218)
- Fix typo in ch5.3 and in CONTRIBUTING.md (rust-lang/book#4216)

## rust-lang/edition-guide

2 commits in 4ed5a1a4a2a7ecc2e529a5baaef04f7bc7917eda..f56aecc3b036dff16404b525a83b00f911b9bbea
2025-02-03 17:14:16 UTC to 2025-01-31 17:44:00 UTC

- Rustc{En,De}codable has been removed (rust-lang/edition-guide#353)
- Remove rustfmt-overflow-delimited-expr (rust-lang/edition-guide#357)

## rust-lang/nomicon

3 commits in bc2298865544695c63454fc1f9f98a3dc22e9948..336f75835a6c0514852cc65aba9a698b699b13c8
2025-02-02 10:06:30 UTC to 2025-02-02 08:35:20 UTC

- Improve grammar in exotic-sizes (rust-lang/nomicon#452)
- other-reprs: Add details for n!=1 repr(packed) (rust-lang/nomicon#460)
- Use `()` instead of `[u8; 0]` in opaque type (rust-lang/nomicon#456)

## rust-lang/reference

3 commits in 93b921c7d3213d38d920f7f905a3bec093d2217d..4249fb411dd27f945e2881eb0378044b94cee06f
2025-01-31 03:43:07 UTC to 2025-01-29 04:17:34 UTC

- Add Spec Identifier Syntax to expressions.md and subchapters (rust-lang/reference#1591)
- Exclude the test summary from the search index (rust-lang/reference#1723)
- Spec inline assembly tests (rust-lang/reference#1648)

## rust-lang/rust-by-example

1 commits in 054259ed1bf01cdee4309ee764c7e103f6df3de5..743766929f1e53e72fab74394ae259bbfb4a7619
2025-02-02 19:53:31 UTC to 2025-02-02 19:53:31 UTC

- Spanish translation to 1:2100 (rust-lang/rust-by-example#1910)
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.

2 participants