-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
len_without_is_empty
improvements
#6980
Conversation
r? @llogiq (rust-highfive has picked a reviewer for you, use r? to override) |
} | ||
|
||
impl LenOutput<'_> { | ||
fn matches_is_empty_output(self, ty: Ty<'_>) -> bool { |
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.
That's a cool idea I hadn't even though of, to check if the output types match with either Option or Result. 👍
Just one possible improvement, otherwise this looks good to me. |
Check the return type of `len`. Only integral types, or an `Option` or `Result` wrapping one. Ensure the return type of `is_empty` matches. e.g. `Option<usize>` -> `Option<bool>`
88bf10e
to
12985af
Compare
Thank you! @bors r+ |
📌 Commit 12985af has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Oh, thanks for fixing this quick. :) |
fixes: #6958
fixes: #6972
changelog: Check the return type of
len
. Only integral types, or anOption
orResult
wrapping one.changelog: Ensure the return type of
is_empty
matches. e.g.Option<usize>
->Option<bool>