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

clippy: map -> inspect when original item is returned #1072

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

muzarski
Copy link
Contributor

Fixing a clippy lints regarding a usage of map() instead of inspect(), when original item (closure argument) is returned from the closure.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • [ ] I added relevant tests for new features and bug fixes.
  • [ ] All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • [ ] I have provided docstrings for the public items that I want to introduce.
  • [ ] I have adjusted the documentation in ./docs/source/.
  • [ ] I added appropriate Fixes: annotations to PR description.

@muzarski muzarski self-assigned this Sep 16, 2024
Copy link

github-actions bot commented Sep 16, 2024

cargo semver-checks found no API-breaking changes in this PR! 🎉🥳
Checked commit: 0314f53

@muzarski
Copy link
Contributor Author

muzarski commented Sep 16, 2024

min_rust is not passing unfortunately. Should we simply ignore these clippy lints (#[allow(clippy::manual_inspect)]) or bump MSRV?

It would require to bump MSRV to 1.76.0 (current is 1.66.0). I think ignoring lints is more reasonable.

@Lorak-mmk
Copy link
Collaborator

The error that I see in CI is that inspect is unstable on MSRV version. In that case you can stop using it: let socket = socket.connect(real_addr).await; /* do something with socket */; socket.

Fixing a clippy lints regarding a usage of `map()` instead
of `inspect()`, when original item (closure argument) is returned
from the closure.
See: https://rust-lang.github.io/rust-clippy/master/index.html#/manual_inspect

Unfortunately, `inspect` was introduced in rust 1.76. Our current MSRV
is 1.66.0, thus we cannot use it.
@muzarski
Copy link
Contributor Author

The error that I see in CI is that inspect is unstable on MSRV version. In that case you can stop using it: let socket = socket.connect(real_addr).await; /* do something with socket */; socket.

Done

@Lorak-mmk Lorak-mmk merged commit 9ff1161 into scylladb:main Sep 16, 2024
11 checks passed
@muzarski muzarski deleted the fix-clippy-0.1.81 branch September 18, 2024 04:51
@wprzytula wprzytula mentioned this pull request Nov 14, 2024
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