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 Rust lints failing on main #249

Merged
merged 1 commit into from
Mar 18, 2025
Merged

Fix Rust lints failing on main #249

merged 1 commit into from
Mar 18, 2025

Conversation

edmorley
Copy link
Member

Since this is blocking other PRs:

    Checking integration-test v0.0.0 (/home/runner/work/heroku-java-metrics-agent/heroku-java-metrics-agent/integration-test)
error: usage of `.map(...).all(identity)`
  --> src/main.rs:88:10
   |
88 |           .map(|window| {
   |  __________^
89 | |             match window {
90 | |                 [earlier_request, later_request] => later_request
91 | |                     .time
...  |
98 | |         })
99 | |         .all(identity));
   | |______________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity
   = note: `-D clippy::map-all-any-identity` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::map_all_any_identity)]`
help: use `.all(...)` instead
   |
88 ~         .all(|window| {
89 +             match window {
90 +                 [earlier_request, later_request] => later_request
91 +                     .time
92 +                     .duration_since(earlier_request.time)
93 +                     .is_ok_and(|duration| {
94 +                         duration.as_millis() > 4500 && duration.as_millis() < 5500
95 +                     }),
96 +                 _ => false,
97 +             }
98 ~         }));
   |

Since this is blocking other PRs:

```
    Checking integration-test v0.0.0 (/home/runner/work/heroku-java-metrics-agent/heroku-java-metrics-agent/integration-test)
error: usage of `.map(...).all(identity)`
  --> src/main.rs:88:10
   |
88 |           .map(|window| {
   |  __________^
89 | |             match window {
90 | |                 [earlier_request, later_request] => later_request
91 | |                     .time
...  |
98 | |         })
99 | |         .all(identity));
   | |______________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity
   = note: `-D clippy::map-all-any-identity` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::map_all_any_identity)]`
help: use `.all(...)` instead
   |
88 ~         .all(|window| {
89 +             match window {
90 +                 [earlier_request, later_request] => later_request
91 +                     .time
92 +                     .duration_since(earlier_request.time)
93 +                     .is_ok_and(|duration| {
94 +                         duration.as_millis() > 4500 && duration.as_millis() < 5500
95 +                     }),
96 +                 _ => false,
97 +             }
98 ~         }));
   |
```
@edmorley edmorley self-assigned this Mar 17, 2025
@edmorley edmorley requested review from Malax and a team as code owners March 17, 2025 12:49
@edmorley edmorley enabled auto-merge (squash) March 17, 2025 12:49
@edmorley edmorley merged commit bc1cc4d into main Mar 18, 2025
35 checks passed
@edmorley edmorley deleted the edmorley/fix-lints branch March 18, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants