Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bevy_utils::default() and prefer <_>::default() #16325

Closed
wants to merge 2 commits into from

Conversation

BenjaminBrienen
Copy link
Contributor

@BenjaminBrienen BenjaminBrienen commented Nov 10, 2024

Objective

Contributes to #11478

Solution

This has been attempted in a different manner before, but I want to see how this version is liked since it uses a more brief syntax than the previous attempt. I'm also interested to see if minds have changed in the last couple months. Close if unwanted.

Testing

CI

Migration Guide

bevy_utils::prelude and bevy_utils::default are removed. Use <_>::default() instead.

@BenjaminBrienen BenjaminBrienen changed the title Remove bevy_utils::default and prefer <_>::default Remove bevy_utils::default() and prefer <_>::default() Nov 10, 2024
@BenjaminBrienen BenjaminBrienen self-assigned this Nov 10, 2024
@BenjaminBrienen BenjaminBrienen added C-Code-Quality A section of code that is hard to understand or change X-Controversial There is active debate or serious implications around merging this PR A-Cross-Cutting Impacts the entire engine D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Nov 10, 2024
@MrGVSV
Copy link
Member

MrGVSV commented Nov 10, 2024

I'm pretty sure Cart added default to reduce the noise in Bevy code, especially in bundles. This PR seems to add more noise (and subjectively more than just using Default::default). It also means more typing since you can't just import default once, but now need to add <_>:: to every call site

@BenjaminBrienen BenjaminBrienen added S-Wontfix This issue is the result of a deliberate design decision, and will not be fixed and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Nov 10, 2024
@BenjaminBrienen BenjaminBrienen deleted the default branch November 10, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Cross-Cutting Impacts the entire engine C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Wontfix This issue is the result of a deliberate design decision, and will not be fixed X-Controversial There is active debate or serious implications around merging this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants