johanhelsing / matchbox

Painless peer-to-peer WebRTC networking for rust wasm (and native!)
Apache License 2.0
848 stars 67 forks source link

Clippy warnings in CI #437

Closed johanhelsing closed 3 months ago

johanhelsing commented 3 months ago

After rust 1.77, we know get clippy warnings in ci:

https://github.com/johanhelsing/matchbox/actions/runs/8407545605/job/23023258077?pr=436

 error: field `1` is never read
  --> bevy_matchbox/src/socket.rs:73:67
   |
73 | pub struct MatchboxSocket<C: BuildablePlurality>(WebRtcSocket<C>, Box<dyn Debug + Send + Sync>);
   |            -------------- field in this struct                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `MatchboxSocket` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
73 | pub struct MatchboxSocket<C: BuildablePlurality>(WebRtcSocket<C>, ());
   |       

To repro:

rustup update
cargo clippy --all-targets --target wasm32-unknown-unknown -p bevy_matchbox -- -D warnings

Did not happen with rust 1.76

The field was added in 4295f6dc by @garryod.

It looks like it's there to just make sure we don't drop the task handle. I'm not sure what the practical difference is between detaching and keeping the handle in the socket, though... Maybe @garryod remembers?

Perhaps we should just add #[allow(dead_code)] for it?