Skip to content
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

Merged
merged 1 commit into from
Apr 24, 2019
Merged

Fix some clippy lints #455

merged 1 commit into from
Apr 24, 2019

Conversation

Alexander-N
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Apr 21, 2019

Codecov Report

Merging #455 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/class/sequence.rs 80.8% <100%> (ø) ⬆️
src/types/sequence.rs 94.28% <100%> (+0.22%) ⬆️
src/types/list.rs 97.14% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77f0974...70c8d4b. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 21, 2019

Codecov Report

Merging #455 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #455      +/-   ##
==========================================
+ Coverage   87.66%   87.66%   +<.01%     
==========================================
  Files          63       63              
  Lines        3355     3356       +1     
==========================================
+ Hits         2941     2942       +1     
  Misses        414      414
Impacted Files Coverage Δ
src/class/sequence.rs 80.8% <100%> (ø) ⬆️
src/types/sequence.rs 94.28% <100%> (+0.22%) ⬆️
src/types/list.rs 97.14% <100%> (ø) ⬆️
src/type_object.rs 88.4% <0%> (-0.12%) ⬇️
src/ffi3/objimpl.rs 0% <0%> (ø) ⬆️
src/ffi3/floatobject.rs 100% <0%> (ø) ⬆️
src/ffi3/modsupport.rs 100% <0%> (ø) ⬆️
src/ffi3/pyerrors.rs 40% <0%> (ø) ⬆️
src/types/dict.rs 93.33% <0%> (ø) ⬆️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7149a1f...6d87934. Read the comment docs.

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
Copy link
Member

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.

Copy link
Member

@kngwyu kngwyu Apr 24, 2019

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 😅

Copy link
Member

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

Copy link
Member

@kngwyu kngwyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -27,6 +27,12 @@ impl PySequence {
}
}

#[inline]
pub fn is_empty(&self) -> PyResult<bool> {
let len = self.len()?;
Copy link
Member

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).

let empty_seq = empty_list.cast_as::<PySequence>(py).unwrap();
assert_eq!(empty_seq.is_empty().unwrap(), true);
}

Copy link
Member

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.

@kngwyu
Copy link
Member

kngwyu commented Apr 22, 2019

Thanks, I left some comments but mostly looks good.

@Alexander-N
Copy link
Member Author

Ok, done.

@kngwyu
Copy link
Member

kngwyu commented Apr 24, 2019

Thanks again

@kngwyu kngwyu merged commit 5cc6b55 into PyO3:master Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants