idanarye / rust-typed-builder

Compile-time type-checked builder derive
https://crates.io/crates/typed-builder
Apache License 2.0
904 stars 52 forks source link

Allow unused type in no_type_leakage test #145

Closed sunsided closed 2 months ago

sunsided commented 2 months ago

A contender for the world's smallest PR.

Right now, the code builds with a warning (for me):

warning: field `0` is never read
  --> tests/no_type_leakage.rs:15:16
   |
15 | pub struct Bar(Foo);
   |            --- ^^^
   |            |
   |            field in this struct
   |
   = note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
15 | pub struct Bar(());
   |             

This PR makes the type

#[allow(unused)]
pub struct Bar(Foo);

To suppress that warning.

idanarye commented 2 months ago

Thanks!