rabbitmq / rabbitmq-stream-rust-client

A client library for RabbitMQ streams
Other
156 stars 15 forks source link

Use an explicit type annotation here #187

Closed michaelklishin closed 1 year ago

michaelklishin commented 1 year ago

References #186.

One hypothesis in #186 was that compiler's type inference fails to determine that the value should be a usize. Since AtomicUsize#fetch_add returns a usize, I highly doubt it is a compiler issue. Instead, the cloning/concurrency factors are more important.

That said, this was trivial to put together, so why not use this PR to verify the hypothesis.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.70% :tada:

Comparison is base (f335c59) 86.80% compared to head (b904487) 87.51%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #187 +/- ## ========================================== + Coverage 86.80% 87.51% +0.70% ========================================== Files 68 68 Lines 5503 5503 ========================================== + Hits 4777 4816 +39 + Misses 726 687 -39 ``` | [Files Changed](https://app.codecov.io/gh/rabbitmq/rabbitmq-stream-rust-client/pull/187?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rabbitmq) | Coverage Δ | | |---|---|---| | [src/producer.rs](https://app.codecov.io/gh/rabbitmq/rabbitmq-stream-rust-client/pull/187?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rabbitmq#diff-c3JjL3Byb2R1Y2VyLnJz) | `80.04% <100.00%> (ø)` | | ... and [9 files with indirect coverage changes](https://app.codecov.io/gh/rabbitmq/rabbitmq-stream-rust-client/pull/187/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rabbitmq)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

michaelklishin commented 1 year ago

This was to demonstrate that this change isn't necessary and prove a certain hypothesis wrong => closing.