Module missing_trait_for_unit_struct

Module missing_trait_for_unit_struct 

Source
Expand description

Checks for unit structs that do not implement Copy, Clone or Default.

§Motivation

This is mainly useful for the Bevy engine itself to ensure a consistent API. For example in order to use a component with required components the component needs to implement Default.

§Example

struct UnitStruct;

Use instead:

#[derive(Copy,Clone,Default)]
struct MyComponent;