Skip to content

Add Asset::get_mut_untracked and map_asset_unchanged #18548

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Waridley
Copy link
Contributor

Initial attempt at solving #18214

get_mut_untracked was simple to add and can be re-used in other methods.

map_asset_unchanged works but is less efficient than it could be with a way to map Mut to two mutable references.

Currently map_asset_unchanged has to call get_mut and unwrap_unchecked every time deref_mut is called. Unless I'm missing something, getting around this would require additional changes to Mut.

@alice-i-cecile alice-i-cecile changed the title Implement #18214 Add Asset::get_mut_untracked and map_asset_unchanged Mar 25, 2025
@alice-i-cecile alice-i-cecile added C-Feature A new feature, making something new possible A-Assets Load files from disk to use for things like images, models, and sounds X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Mar 25, 2025
`get_mut_untracked` was simple to add and can be re-used in other methods.

`map_asset_unchanged` works but is less efficient than it could be with a way to map `Mut` to *two* mutable references -- `self.queued_events` and the actual stored asset.
@Waridley Waridley force-pushed the assets_map_unchanged branch from a11acdb to cc1e71f Compare April 15, 2025 04:06
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-Feature A new feature, making something new possible D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged X-Uncontroversial This work is generally agreed upon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants