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 Clippy warnings #264

Merged
merged 2 commits into from
Jul 27, 2023
Merged

Conversation

primeos-work
Copy link
Member

New warnings appeared since the beta toolchain was bumped to 1.72 (after stable got bumped to 1.71.0: https://blog.rust-lang.org/2023/07/13/Rust-1.71.0.html - I planned on adding those commits to #263 as the Rust/Clippy version got bumped between the PR was opened and merged but I forgot about it during the weekend (and they're unrelated to that PR)).

Anyway, this just fixes an optional CI check to make everything green again :)

Detected and fixed via new lints in clippy 0.1.72 (beta toolchain).
This fixes the "explicit call to `.into_iter()` in function argument
accepting `IntoIterator`" linting warnings [0].

[0]: https://rust-lang.github.io/rust-clippy/master/index.html#/useless_conversion

Signed-off-by: Michael Weiss <michael.weiss@atos.net>
This fixes the "usage of `Iterator::fold` on a type that implements
`Try`" linting warnings that got detected via a new lint [0] in clippy
0.1.72 (beta toolchain) but must be fixed manually. Motivation:
> The code should use try_fold instead, which short-circuits on failure,
> thus opening the door for additional optimizations not possible with
> fold as rustc can guarantee the function is never called on None, Err,
> etc., alleviating otherwise necessary checks. It’s also slightly more
> idiomatic.

[0]: https://rust-lang.github.io/rust-clippy/master/index.html#/manual_try_fold

Signed-off-by: Michael Weiss <michael.weiss@atos.net>
@ammernico ammernico added this pull request to the merge queue Jul 27, 2023
Merged via the queue into science-computing:master with commit ba6594a Jul 27, 2023
13 checks passed
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.

2 participants