Repository navigation
Conversation
Chapter 6 teaches `let...else`, but three places that enumerate where patterns or `else` appear left it out: the Chapter 6 overview, the `else` entry in Appendix A, and Chapter 19's tour of all the places patterns can be used. Add it to each, with a short `let...else` subsection in Chapter 19 next to the `if let` one. Fixes rust-lang#4869
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4869
Chapter 6 teaches
let...else(and the table of contents names it), but three places that enumerate where patterns orelseappear still leave it out. This adds it to each of them:src/ch06-00-enums.md: the chapter overview now ends with "theif letandlet...elseconstructs" instead of onlyif let.src/appendix-01-keywords.md: theelseentry now reads "Fallback forif,if let, andlet...elsecontrol flow constructs".src/ch19-01-all-the-places-for-patterns.md: the sentence "Prior to this chapter, we had only explicitly discussed using patterns withmatchandif let" now also nameslet...elseandwhile let(both were discussed in earlier chapters), and there is a new short "let...elseStatements" subsection after theif letone. It describes whatlet...elsebinds, that theelseblock must diverge, and that it accepts a refutable pattern, which hands off to the next section on refutability. The example is a three-linerust,ignoreblock, so no listing directory is added.Prose is wrapped at 80 columns like the surrounding text. Nothing under
nostarch/is touched.