-
Notifications
You must be signed in to change notification settings - Fork 1.7k
lint idea: useless_default_generic_parameters
#14848
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
Comments
+1, I think that's a good idea. |
I'm not 100% satisfied with the name of the lint " |
+1, we had this as Rust-for-Linux/linux#1128 as a kernel-specific |
It has to work with allow/deny sentences, such as in "allow useless default parameters", so |
Ah I see, I didn't check, since I think putting this in clippy is the right way, there is nothing kernel-specific or obscure about this lint :) |
unnecessary_generic
useless_default_parameters
that sounds much better :) |
useless_default_parameters
useless_default_generic_parameters
Yeah, definitely. (To clarify, they are not exclusive, i.e. ideally it would be faster to add a |
|
What it does
Given a type with a generic argument that has a default:
Usage of this type when specifying the default should not use generics:
Advantage
Drawbacks
Example
Could be written as:
The text was updated successfully, but these errors were encountered: