-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
A-lintArea: New lintsArea: New lintsgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
What it does
PhantomData::default()
is quite common https://github.com/search?q=language%3ARust+%22PhantomData%3A%3Adefault%28%29%22&type=code&ref=advsearch though of course the ::default()
is actually redundant.
Perhaps a lint that suggests removing the ::default()
would be useful?.
Lint Name
No response
Category
style, pedantic
Advantage
Shorter, ostensibly avoids a function call.
Drawbacks
Perhaps
Foo {
_marker: PhantomData::default()
}
makes more sense to some people than the slightly special
Foo {
_marker: PhantomData
}
Example
Foo {
_marker: PhantomData::default()
}
Could be written as:
Foo {
_marker: PhantomData
}
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy