-
-
Notifications
You must be signed in to change notification settings - Fork 480
Fix new Clippy lints #1511
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
Fix new Clippy lints #1511
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,7 +110,7 @@ pub trait Distribution<T> { | |
| } | ||
| } | ||
|
|
||
| impl<'a, T, D: Distribution<T> + ?Sized> Distribution<T> for &'a D { | ||
| impl<T, D: Distribution<T> + ?Sized> Distribution<T> for &D { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clippy is pedantically complaining that we're being too pedantic? (Sorry, I'll drop the sarcasm! This is fine.)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Heh, to be fair, it's a good lint for raising awareness that such elision is allowed. As an "old-timer" who was using Rust since before 1.31, I automatically was using the "pedantic" style everywhere. |
||
| fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> T { | ||
| (*self).sample(rng) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is changed because of the following warning:
AFAIK we can not use this trait with DSTs either way, since we store core by value, so the
?Sizedbound is not needed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust does permit the last field of a struct to be unsized, but I can't see it being useful.
In this case we can drop the
+ Sizedbound three lines up.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, TIL. I guess it's not surprising I did not encounter it in practice since in its current form it's a virtually useless feature and even docs state that: