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
Since #222, Default must be implemented to derive LdtkEntity, LdtkIntCell etc.
This does not interact well with #[from_entity_instance] and similar attributes, as I was using the attributes on fields where there is no reasonable way to implement Default (like a struct containing a Box<dyn ...>). With the change, I either have to:
impl Default for my field to I can derive it for my LdtkEntity type, or
manually impl Default for my LdtkEntity type, still requiring me to create a field instance out of thin air
While I could make up some value just to be able to implement Default, doing so would feel like a misuse of the Default trait.
The text was updated successfully, but these errors were encountered:
…acros
Add an attribute that initializes fields using individual field Default
implementations, allowing to use the derive macros again without
requiring the whole struct to implement Default (when some fields should
be default-initialized and others use initialization attributes
like #[from_entity_instance]).
FixesTrouv#305
…acros
Add an attribute that initializes fields using individual field Default
implementations, allowing to use the derive macros again without
requiring the whole struct to implement Default (when some fields should
be default-initialized and others use initialization attributes
like #[from_entity_instance]).
FixesTrouv#305
Since #222,
Default
must be implemented to deriveLdtkEntity
,LdtkIntCell
etc.This does not interact well with
#[from_entity_instance]
and similar attributes, as I was using the attributes on fields where there is no reasonable way to implementDefault
(like a struct containing aBox<dyn ...>
). With the change, I either have to:impl Default
for my field to I can derive it for myLdtkEntity
type, orimpl Default
for myLdtkEntity
type, still requiring me to create a field instance out of thin airWhile I could make up some value just to be able to implement
Default
, doing so would feel like a misuse of theDefault
trait.The text was updated successfully, but these errors were encountered: