Idiomatic: Various tweaks and cleanup to common traits section#3163
Merged
mgeisler merged 4 commits intogoogle:mainfrom Apr 28, 2026
Merged
Idiomatic: Various tweaks and cleanup to common traits section#3163mgeisler merged 4 commits intogoogle:mainfrom
mgeisler merged 4 commits intogoogle:mainfrom
Conversation
mgeisler
approved these changes
Apr 20, 2026
auto-merge was automatically disabled
April 21, 2026 20:05
Head branch was pushed to by a user without write access
mgeisler
approved these changes
Apr 28, 2026
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.
Various tweaks and cleanup to the "Implementing Common Traits" section of Idiomatic based on my first time teaching the class.
mainfunction with example code to a few slides that were not demonstrating the behavior of the traits.copy.mdCopyis an implicit operation, whereasCloneis an explicit, user-defined operation.CopyandCloneshould be derived together.Copytypes cannot implDrop, and reorganize notes so that they render more clearly in the speaker notes.display.md- Remove reference to theErrortrait and shift focus to highlight the differences betweenDebugandDisplay. I don't think mentioningErroris bad per se, but I think it's the wrong thing to focus on here.\from-into.mdObviousImplementationtoWrapperto make things more concise and easier to read.Fromimpls to be for&strandi32, to better demonstrate howFromcan support conversions from multiple unrelated types.Intois a more natural trait bound thanFrom.