You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement #[derive_where(Clone; T = u8)], which will generate impl Clone for Test<u8>.
Crate feature to disable warnings, currently errors that don't prevent derive-where from functioning correctly but point to invalid use-cases (use std derive) instead or bad code quality (empty bracers). Currently Rust doesn't have a compile_warn.
Remove quote and build any Rust code purely with syn structures instead.
Improve generated code, mainly remove match and access fields directly when not dealing with an enum. This is mainly modeled after std's derive, which was probably done to make it easy to implement as it makes code generation between enums and structs very similar, but after many refactors, there is no real advantage anymore.
Use once-cell or something similar to cache patterns and Idents, some implementation don't need them, but we don't want to generate them ad-hoc as they do some allocations. The main concern here is adding another dependency.
Use arrayvec or something similar to store traits, reducing overall allocations. We know what the maximum amount of possible traits are, no need to do any allocations. To reduce dependencies we could make our own.
Use smallvec or something similar to store fields and such, we don't expect structs to have an unlimited amount of fields. Again, another dependency.
Make a companion non-proc-macro crate for all the various Assert structs and traits.
These are code improvements or features that could be added in the future if demand is there:
nightlycrate feature and remove parts of thesafecrate feature implementation.PartialOrdandOrdcodegen, done in Improve code generation ofOrdandPartialOrd#38.#[derive_where(Clone; T = u8)], which will generateimpl Clone for Test<u8>.derive) instead or bad code quality (empty bracers). Currently Rust doesn't have acompile_warn.quoteand build any Rust code purely with syn structures instead.matchand access fields directly when not dealing with an enum. This is mainly modeled after std'sderive, which was probably done to make it easy to implement as it makes code generation between enums and structs very similar, but after many refactors, there is no real advantage anymore.Idents, some implementation don't need them, but we don't want to generate them ad-hoc as they do some allocations. The main concern here is adding another dependency.Assertstructs and traits.