http-rs / http-types

Common types for HTTP operations
https://docs.rs/http-types
Apache License 2.0
200 stars 83 forks source link

Fix all failing clippy lints for backports branch #399

Closed arlyon closed 2 years ago

arlyon commented 2 years ago

Hi

I am interested in getting #396 merged and noticed it is blocked due to failing clippy lints on this branch. I have simply run through and fixed them.

arlyon commented 2 years ago

There seems to be a test that is (consistently) broken on this branch as well, having failed both CI runs: https://github.com/http-rs/http-types/runs/5734932654?check_suite_focus=true

arlyon commented 2 years ago

More investigation: tests pass on rust version 1.59.0, fail on version 1.61.0-nightly. Seems like some float rounding issues.

failures:

---- trace::server_timing::parse::test::decode_headers stdout ----
thread 'trace::server_timing::parse::test::decode_headers' panicked at 'assertion failed: `(left == right)`
  left: `Some(52.999999ms)`,
 right: `Some(53ms)`', src/trace/server_timing/parse.rs:162:9

failures:
    trace::server_timing::parse::test::decode_headers

test result: FAILED. 180 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

error: test failed, to rerun pass '--lib'
Fishrock123 commented 2 years ago

In the future, you may want to run cargo clippy --workspace --all-targets to catch everything.