Fix code errors, typos, and grammar across 19 files#28
Open
jwiegley wants to merge 26 commits intocognitive-engineering-lab:mainfrom
Open
Fix code errors, typos, and grammar across 19 files#28jwiegley wants to merge 26 commits intocognitive-engineering-lab:mainfrom
jwiegley wants to merge 26 commits intocognitive-engineering-lab:mainfrom
Conversation
In C++ 'this' is a pointer, not a reference. Using 'this.member' will not compile. Changed to 'this->member' in inheritance_and_reuse.md and object_identity.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The for loops in placement_new.md declared 'std::size_t i;' without initialization, producing undefined behavior. Added '= 0' to both loop variable declarations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The function named 'twice' was computing n * n (squaring) instead of n * 2 (doubling). Fixed in both the C++ and Rust examples in the function-to-pointer section of promotions_and_conversions.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The unit vector check was computing x^2 + xy instead of x^2 + y^2. Changed 'v.y * v.x' to 'v.y * v.y' in the Normalized::from_vec2 method. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Used the C++ name 'Optional' instead of the Rust type name 'Option'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three instances of the ErrorB C++ struct had a message string saying "ErrorA was produced" instead of "ErrorB was produced". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Renamed might_throw_A and might_throw_B to might_throw_a and might_throw_b to follow Rust's snake_case naming convention. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Renamed twicePtr, ctorPtr, methodPtr, closureRes to twice_ptr, ctor_ptr, method_ptr, closure_res in the function-to-pointer Rust example in promotions_and_conversions.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Changed 'both requires' to 'both require'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 'idomatic' -> 'idiomatic' - 'defintion' -> 'definition' - 'using and Rust's' -> 'using Rust's' (extra word) - 'C++ template' -> 'a C++ template' (missing article) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 'with with' -> 'with' (duplicate word) - 'can either be overloaded either' -> 'can be overloaded either' - 'operator' -> 'operators' (missing plural) - 'desireable' -> 'desirable' Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 'iterable sequence' -> 'an iterable sequence' (missing article) - 'accessiable' -> 'accessible' (2 occurrences) - 'invaliding' -> 'invalidating' Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 'Even when the a client of the library is needs' -> 'Even when a client of the library needs' - 'an be used' -> 'can be used' - 'can managing' -> 'can manage' - Replace TODO comment with actual link to visitor pattern chapter Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 'Unless otherwise state' -> 'Unless otherwise stated' (both files) - 'the The Rust Unstable Book' -> 'the Rust Unstable Book' - 'what is need' -> 'what is needed' Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix "remaning" → "remaining", "accesssible" → "accessible", "accessbile" → "accessible", and "is not breaking change" → "is not a breaking change". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix "are is often used" → "are often used" and add missing space before "trait" in DerefMut link. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix "are in-band value that indicates" → "are in-band values that indicate". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix "intended to used be indices" → "intended to be used as indices", "This results a situation" → "This results in a situation", and clarify "constructors (proper constructors)" → "tuple struct constructors". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix "in few more ways" → "in a few more ways" and "traits implementations" → "trait implementations". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix "others cases" → "other cases" and remove duplicated "by" in "handled by instead by". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix "The most approach depends" → "The best approach depends". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The concurrency chapter doesn't exist yet, so remove the empty link brackets to avoid a broken link in the rendered book. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
this.→this->in C++ examples, uninitialized loop variable (UB),twice()computing square instead of double, math error in normalization check,Optional<Box<T>>→Option<Box<T>>, ErrorB copy-paste error, snake_case violations in Rust examples, and camelCase variable names in Rust codeEach fix is in its own atomic commit for easy review.
Test plan
mdbook buildsucceeds without errorsthis->fixes and loop variable initialization)Option<Box<T>>fix and snake_case renames)🤖 Generated with Claude Code