scylladb / scylla-rust-driver

Async CQL driver for Rust, optimized for ScyllaDB!
Apache License 2.0
571 stars 99 forks source link

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

Closed muzarski closed 2 weeks ago

muzarski commented 2 weeks ago

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

github-actions[bot] commented 2 weeks ago

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

muzarski commented 2 weeks ago

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 commented 2 weeks ago

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.

muzarski commented 2 weeks ago

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