Deriving Validator on a struct with default type parameters fail to build
Opened this issue · 5 comments
jobs62 commented
Hi,
we have a struct difined as followed:
#[derive(Debug, Deserialize, JsonSchema, Validator)]
pub struct PaginationQuery<T = ()> {
#[serde(flatten)]
pub args: T,
...
}
after updating to validator 0.17, clippy fail to build with message.
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
note: `#[deny(invalid_type_param_default)]` on by default
Keats commented
Can someone make a PR with a failing test? I don't think we have anything looking like that in our tests so not surprising we have a regresison
Keats commented
Thanks I'll have a look soon (unless someones beats me to it, which is likely)
jobs62 commented
i just tested, it work perfectly. Thanks !