Bevy version and features
What you did
Using avian2d I noticed that adding CollisionLayers as a required component can cause clippy to report a lint if the collision layers (memberships and filters) are the same:
#[derive(Component, Default, Clone)]
#[require(
CollisionLayers::new(CollisionLayer::Layer1, CollisionLayer::Layer1),
)]
pub struct MyComponent;
CollisionLayer is an enum with several variants and derives Avian's PhysicsLayer. And, to add some extra context, CollisionLayers::new(CollisionLayer::Layer1, CollisionLayer::Layer1) means the entity will be a member of collision layer Layer1 and will collide with other members of Layer2. This is something valid and has nothing to do with duplicated attributes.
What went wrong
Here's the lint/warning, which suggests to "remove the duplicate attribute":
duplicated attribute
for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#duplicated_attributes
`#[warn(clippy::duplicated_attributes)]`
This doesn't happen when adding the component to spawn or spawn_scene calls, which makes me think there might be an issue with the require attribute.
Bevy version and features
What you did
Using avian2d I noticed that adding
CollisionLayersas a required component can cause clippy to report a lint if the collision layers (memberships and filters) are the same:CollisionLayeris an enum with several variants and derives Avian'sPhysicsLayer. And, to add some extra context,CollisionLayers::new(CollisionLayer::Layer1, CollisionLayer::Layer1)means the entity will be a member of collision layerLayer1and will collide with other members ofLayer2. This is something valid and has nothing to do with duplicated attributes.What went wrong
Here's the lint/warning, which suggests to "remove the duplicate attribute":
This doesn't happen when adding the component to
spawnorspawn_scenecalls, which makes me think there might be an issue with therequireattribute.