-
Notifications
You must be signed in to change notification settings - Fork 784
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 some clippy lints #455
Conversation
Codecov Report
@@ Coverage Diff @@
## master #455 +/- ##
==========================================
+ Coverage 87.64% 87.66% +0.01%
==========================================
Files 63 63
Lines 3352 3356 +4
==========================================
+ Hits 2938 2942 +4
Misses 414 414
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #455 +/- ##
==========================================
+ Coverage 87.66% 87.66% +<.01%
==========================================
Files 63 63
Lines 3355 3356 +1
==========================================
+ Hits 2941 2942 +1
Misses 414 414
Continue to review full report at Codecov.
|
py: Python<'p>, | ||
elements: impl IntoIterator<Item = T, IntoIter = U>, | ||
) -> &'p PyList | ||
pub fn new<T, U>(py: Python<'_>, elements: impl IntoIterator<Item = T, IntoIter = U>) -> &PyList |
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.
Is this a new grammar?
Great.
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.
Oh it was stabilized a year ago rust-lang/rust#49458.
Maybe I have to learn Rust once more 😅
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.
The edition guide and the official rust blog (esp. the release notes) are really good resources for that
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.
LGTM
src/types/sequence.rs
Outdated
@@ -27,6 +27,12 @@ impl PySequence { | |||
} | |||
} | |||
|
|||
#[inline] | |||
pub fn is_empty(&self) -> PyResult<bool> { | |||
let len = self.len()?; |
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.
I prefer to self.len().map(|l| l == 0)
.
src/types/sequence.rs
Outdated
let empty_seq = empty_list.cast_as::<PySequence>(py).unwrap(); | ||
assert_eq!(empty_seq.is_empty().unwrap(), true); | ||
} | ||
|
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.
Just a nit but I don't like this empty line.
Thanks, I left some comments but mostly looks good. |
Ok, done. |
Thanks again |
No description provided.