Gilnaa / memoffset

offsetof for Rust
MIT License
224 stars 29 forks source link

Suppress `clippy::unneeded_wildcard_pattern` #64

Closed yvt closed 2 years ago

yvt commented 2 years ago

This PR fixes offset_of_tuple! causing clippy warnings in consumer code.

warning: this pattern is unneeded as the `..` pattern can match that element
   --> src/raw_field.rs:74:14
    |
74  |         let (_, ..): $type;
    |              ^^^ help: remove it
    |
   ::: src/lib.rs:101:9
    |
101 |         offset_of_tuple!((i32, f32, u8), 1)
    |         ----------------------------------- in this macro invocation
    |
    = note: `#[warn(clippy::unneeded_wildcard_pattern)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_wildcard_pattern
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
RalfJung commented 2 years ago

Thanks for the PR!

Ah, this is the worst macro spaghetti I have ever seen.^^ But I guess it is consistent with what we do for _memoffset__field_check, so -- seems good, aside from a nit.