Fix concept-continuity slips in chapter prose#34
Merged
Conversation
Audit chapters for concepts used before introduction and misplaced/dangling cross-references: - strings: retitle 'Your first function' (reader wrote functions in the integers chapter already) - functions: drop dangling reference to a non-existent 'countdown' exercise; introduce recursion fresh - tuples: stop claiming '*' deref is not yet introduced (it was taught in the hashmaps chapter) - structs: point to the moves/borrowing chapters, not the ownership chapter that comes later - password validator: fix '?' in a String-returning snippet (would not compile; matches intro's .unwrap()); drop reference to undefined 'PasswordAdvisor' - smart pointers: Box<dyn Error> is introduced in the env-file parser chapter, not the earlier '?' operator chapter
- conditionals/loops: introduce the &[i32] slice at point of use in count_evens, before the borrowing and vectors chapters cover slices/references properly - quiz: correct the 'longest' lifetime question (the return is bound to *no longer than* the shorter input, not 'at least as long as' it) - quiz: drop smart-pointer content (RefCell::borrow, Rc/Arc/SharedPtr) so learners who skip the bonus smart-pointers chapter aren't tested on it
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.
What
A step-by-step continuity pass over the course, checking two things per chapter:
Chapters 00-02 were reviewed in detail by hand; 03-25 were inventoried (concepts introduced vs. used) and reconciled against the running ledger, then each flagged spot was verified before editing.
Changes (all prose / doc-comments, no behavior change)
# Your first function— but the reader implemented three functions in the integers chapter# A welcome message4_sum_toreferences acountdownexercise that exists nowhere in the course*deref among syntax "we haven't formally introduced yet" — but it was taught in the hashmaps chapter?in aString-returning function (won't compile; the chapter intro uses.unwrap()for the same code).unwrap()PasswordAdvisor, a type never defined anywhereBox<dyn Error>is something "you'll meet in the?operator chapter" — that chapter is earlier and defersBox<dyn Error>to the env-file parser chapterValidation
./scripts/check-solutions.sh— 75/75 solutions compile + tests pass./scripts/check-examples.sh— all chapters in their expected stateNotes / deliberately left alone
const fnin the structs chapter's scaffolding initially looked like an unexplained concept, but it's required to satisfy clippy'smissing_const_for_fnunder the examples check's-D warnings. Reverted to respect the repo's lint policy.count_evensexercise uses&[i32]slices before the borrowing (05) and vectors (08) chapters. This is consistent with the documented "ownership spiral" design (introduce briefly at point of use, with a hint), so I left it; flagging here in case you'd rather restructure it.Rc/Arc/RefCellfrom the smart-pointers chapter, which is markedbonus. A learner who skips the bonus would meet those cold in the quiz. Not changed (design call), noted for awareness.