-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 clippy issue on Rust 1.75 #11492
Conversation
With the recent release of Rust 1.75 there were some new clippy rules enabled. There was one minor usage issue highlighted in the new release. While we pin the rust version in CI when building and running clippy locally with the latest version this would trigger a failure. This commit fixes the one issue highlighted by clippy on Rust 1.75 which replaces `Vec<T>.get(0)` with `Vec<T>.first()`.
One or more of the the following people are requested to review this:
|
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'm not wild about Clippy newly turning on subjective style stuff like this at deny-by-default, but it is what it is. Still good to make Clippy happy.
If we were MSRV 1.65+, we could have done this as a one-liner:
let Some(first_elem) = memory.first() else { return Ok(Vec::<String>::new().to_object(py)) };
but no let-else for us in 1.64 land.
Pull Request Test Coverage Report for Build 7414974491
💛 - Coveralls |
See #11493 we can wait on that to merge first and then update this to use that |
Oh no need to change it - it's just another stylistic thing. It was only on my mind because I think let-else was one of the things we talked about when deciding between 1.64 and 1.65. |
With the recent release of Rust 1.75 there were some new clippy rules enabled. There was one minor usage issue highlighted in the new release. While we pin the rust version in CI when building and running clippy locally with the latest version this would trigger a failure. This commit fixes the one issue highlighted by clippy on Rust 1.75 which replaces `Vec<T>.get(0)` with `Vec<T>.first()`.
Summary
With the recent release of Rust 1.75 there were some new clippy rules enabled. There was one minor usage issue highlighted in the new release. While we pin the rust version in CI when building and running clippy locally with the latest version this would trigger a failure. This commit fixes the one issue highlighted by clippy on Rust 1.75 which replaces
Vec<T>.get(0)
withVec<T>.first()
.Details and comments