Remove unused parts of AssetLoaders::find#23703
Open
greeble-dev wants to merge 4 commits intobevyengine:mainfrom
Open
Remove unused parts of AssetLoaders::find#23703greeble-dev wants to merge 4 commits intobevyengine:mainfrom
AssetLoaders::find#23703greeble-dev wants to merge 4 commits intobevyengine:mainfrom
Conversation
…so removed `Option` from the `asset_path` member.
…nused `loader_name` member from `AssetLoadError::MissingAssetLoader`.
andriyDev
approved these changes
Apr 7, 2026
Contributor
andriyDev
left a comment
There was a problem hiding this comment.
Nice! Funnily enough I think I made a similar change in one of my branches. Not sure where that ended up haha. Good to see this make it in though, thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
AssetLoaders::findmaps from various properties to an asset loader:But in practice the
type_nameandextensionparameters are alwaysNone, and theasset_pathparameter is alwaysSome.Solution
This PR removes the unused parts:
fn find( &self, - type_name: Option<&str>, asset_type_id: Option<TypeId>, - extension: Option<&str>, - asset_path: Option<&AssetPath<'_>>, + asset_path: &AssetPath<'_>, ) -> Option<MaybeAssetLoader> {AssetLoaders::findispub(crate), so this should not affect users.I looked back at the original PR and couldn't spot any cases where these parameters were ever used. I'm not sure if that's an oversight or if they were intended for future use.
I also made matching changes to
AssetLoaderError::MissingAssetLoaders. This ispubso technically should have a migration guide. I'm not entirely convinced that's necessary for such a trivial change, but happy to add one if requested.MissingAssetLoader { - loader_name: Option<String>, asset_type_id: Option<TypeId>, - extension: Option<String>, - asset_path: Option<String>, + asset_path: String, },Testing