Use Self
in implementations whenever possible #110
Labels
No labels
bug
design
duplicate
enhancement
maintenance
prospective
question
regression
stub
todo
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: StudioInfinity/dyna3#110
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In the implementations of structures and traits, we should avoid repetition by using
Self
type alias whenever possible, as discussed in this comment and the following ones. This style seems to be used to some extent in the source code for the Rust standard library and for nalgebra. For example:Vec::new
.ColPivQR::new
from nalgebra.BTreeSet::new_in
—which is newly added code, and therefore might reflect current conventions.The main downside I see to this style is that it can make the source harder to navigate, because it's context-dependent.