chore: Fix more clippy lints#3585
Conversation
There was a problem hiding this comment.
Pull request overview
This PR is a small test-only cleanup that replaces Clippy-disfavored boolean equality/inequality assertions with the equivalent assert_eq!/assert_ne! forms. It keeps the existing test intent unchanged while aligning the test suite with Rust lint expectations in neqo-transport.
Changes:
- Replaced
assert!(*client.state() != State::Connected)withassert_ne!(*client.state(), State::Connected). - Replaced
assert!(c_stats_before.dropped_rx == 0)withassert_eq!(c_stats_before.dropped_rx, 0).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
neqo-transport/tests/retry.rs |
Updates one retry-path test assertion to use assert_ne! without changing test behavior. |
neqo-transport/src/connection/tests/handshake.rs |
Updates one handshake-statistics assertion to use assert_eq! without changing test behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Straightforward clippy lint fixes — assert!(x == y) → assert_eq! and assert!(x != y) → assert_ne!. Both replacements are semantically equivalent and produce better error messages on failure (printing both operands instead of just false).
I grepped for remaining assert!(... == ...) / assert!(... != ...) patterns across the repo. The remaining instances are all compound conditions (e.g., assert!(a == 1 || b == 1)), inside closures (assert!(iter.any(|x| x == ...))), or const_assert! — none of which are candidates for this transformation. This PR covers the actionable cases.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3585 +/- ##
==========================================
- Coverage 95.00% 94.87% -0.13%
==========================================
Files 109 114 +5
Lines 37586 37931 +345
Branches 37586 37931 +345
==========================================
+ Hits 35709 35988 +279
- Misses 1187 1241 +54
- Partials 690 702 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Benchmark resultsNo significant performance differences relative to ffa0aa2. All resultstransfer/1-conn/1-100mb-resp (aka. Download): No change in performance detected. time: [200.87 ms 201.22 ms 201.58 ms]
thrpt: [496.08 MiB/s 496.96 MiB/s 497.84 MiB/s]
change:
time: [-0.1979% +0.0640% +0.3212] (p = 0.62 > 0.05)
thrpt: [-0.3202% -0.0640% +0.1983]
No change in performance detected.transfer/1-conn/10_000-parallel-1b-resp (aka. RPS): No change in performance detected. time: [287.02 ms 288.88 ms 290.70 ms]
thrpt: [34.400 Kelem/s 34.616 Kelem/s 34.840 Kelem/s]
change:
time: [-0.6167% +0.2721% +1.1304] (p = 0.56 > 0.05)
thrpt: [-1.1178% -0.2714% +0.6205]
No change in performance detected.
Found 5 outliers among 100 measurements (5.00%)
4 (4.00%) low mild
1 (1.00%) high mildtransfer/1-conn/1-1b-resp (aka. HPS): No change in performance detected. time: [38.694 ms 38.838 ms 39.001 ms]
thrpt: [25.640 B/s 25.748 B/s 25.844 B/s]
change:
time: [-0.2824% +0.2419% +0.7475] (p = 0.36 > 0.05)
thrpt: [-0.7420% -0.2413% +0.2832]
No change in performance detected.
Found 7 outliers among 100 measurements (7.00%)
2 (2.00%) high mild
5 (5.00%) high severetransfer/1-conn/1-100mb-req (aka. Upload): Change within noise threshold. time: [203.15 ms 203.67 ms 204.31 ms]
thrpt: [489.45 MiB/s 490.98 MiB/s 492.26 MiB/s]
change:
time: [-0.8645% -0.5057% -0.1245] (p = 0.01 < 0.05)
thrpt: [+0.1246% +0.5082% +0.8720]
Change within noise threshold.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high severestreams/walltime/1-streams/each-1000-bytes: No change in performance detected. time: [586.66 µs 589.41 µs 592.42 µs]
change: [-0.2229% +0.3322% +0.9267] (p = 0.27 > 0.05)
No change in performance detected.
Found 17 outliers among 100 measurements (17.00%)
17 (17.00%) high severestreams/walltime/1000-streams/each-1-bytes: No change in performance detected. time: [12.285 ms 12.322 ms 12.377 ms]
change: [-0.1517% +0.2905% +0.8825] (p = 0.27 > 0.05)
No change in performance detected.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severestreams/walltime/1000-streams/each-1000-bytes: No change in performance detected. time: [44.428 ms 44.477 ms 44.528 ms]
change: [-0.1752% -0.0171% +0.1482] (p = 0.84 > 0.05)
No change in performance detected.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mildtransfer/walltime/pacing-false/varying-seeds: Change within noise threshold. time: [23.415 ms 23.441 ms 23.475 ms]
change: [-0.6788% -0.4539% -0.2486] (p = 0.00 < 0.05)
Change within noise threshold.
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severetransfer/walltime/pacing-true/varying-seeds: Change within noise threshold. time: [23.458 ms 23.473 ms 23.489 ms]
change: [-1.9561% -1.8463% -1.7361] (p = 0.00 < 0.05)
Change within noise threshold.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mildtransfer/walltime/pacing-false/same-seed: Change within noise threshold. time: [23.245 ms 23.268 ms 23.292 ms]
change: [-0.4661% -0.3466% -0.2247] (p = 0.00 < 0.05)
Change within noise threshold.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severetransfer/walltime/pacing-true/same-seed: Change within noise threshold. time: [23.886 ms 23.901 ms 23.917 ms]
change: [+1.1903% +1.2919% +1.3858] (p = 0.00 < 0.05)
Change within noise threshold.
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high mildDownload data for |
Failed Interop TestsQUIC Interop Runner, client vs. server, differences relative to
All resultsSucceeded Interop TestsQUIC Interop Runner, client vs. server neqo-pr as client
neqo-pr as server
Unsupported Interop TestsQUIC Interop Runner, client vs. server neqo-pr as client
neqo-pr as server
|
Client/server transfer resultsPerformance differences relative to ffa0aa2. Transfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.
Table above only shows statistically significant changes. See all results below. All resultsTransfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.
Download data for |
No description provided.