Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format self types to a canonical form when possible #5257

Open
Tracked by #83
nagisa opened this issue Mar 8, 2022 · 0 comments · May be fixed by #5264
Open
Tracked by #83

Format self types to a canonical form when possible #5257

nagisa opened this issue Mar 8, 2022 · 0 comments · May be fixed by #5264

Comments

@nagisa
Copy link
Member

nagisa commented Mar 8, 2022

struct Peach;

impl Peach {
    fn apple(self: Self) {}
    fn banana(self: &Self) {}
    fn chaenomeles(self: &mut Self) {}
}

all of these receivers have a more canonical form which ~everybody uses:

struct Peach;

impl Peach {
    fn apple(self) {}
    fn banana(&self) {}
    fn chaenomeles(&mut self) {}
}

This kind of thing can come up if refactoring the receiver to no longer use one of the smart pointers, or perhaps somebody considers this syntax to be more consistent (which it is, but in a typical codebase which typically utilizes the conventional form it'll stick out as a sore thumb)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants