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

[Merged by Bors] - Small improvement of code quality of Assets::set* methods #1649

Closed
wants to merge 1 commit into from

Conversation

simgt
Copy link

@simgt simgt commented Mar 13, 2021

As mentioned in #1609.

I'm not sure if this is desirable, but on top of factoring the set and set_untracked methods I added a warning when the return value of set isn't used to mitigate similar issues.

I silenced it for the only occurence where it's currently done

assets.set(result.id, result.asset);

Also add a warning when the return value of ::set isn't used.
@alice-i-cecile alice-i-cecile added A-Assets Load files from disk to use for things like images, models, and sounds C-Code-Quality A section of code that is hard to understand or change labels Mar 13, 2021
@cart
Copy link
Member

cart commented Mar 14, 2021

I dig it!

@cart
Copy link
Member

cart commented Mar 14, 2021

bors r+

bors bot pushed a commit that referenced this pull request Mar 14, 2021
As mentioned in #1609.

I'm not sure if this is desirable, but on top of factoring the `set` and `set_untracked` methods I added a warning when the return value of `set` isn't used to mitigate similar issues.

I silenced it for the only occurence where it's currently done  https://github.com/bevyengine/bevy/blob/68606934e32ab45828c628e1cefd3873273f8708/crates/bevy_asset/src/asset_server.rs#L468
@bors bors bot changed the title Small improvement of code quality of Assets::set* methods [Merged by Bors] - Small improvement of code quality of Assets::set* methods Mar 14, 2021
@bors bors bot closed this Mar 14, 2021
@DJMcNab
Copy link
Member

DJMcNab commented Jul 16, 2021

@notsimon please respond in #2373 for the relicense to MIT/Apache 2.0. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Code-Quality A section of code that is hard to understand or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants