diff --git a/crates/bevy_asset/src/asset_server.rs b/crates/bevy_asset/src/asset_server.rs index fafff560083469..2847c3f703f698 100644 --- a/crates/bevy_asset/src/asset_server.rs +++ b/crates/bevy_asset/src/asset_server.rs @@ -133,8 +133,8 @@ impl AssetServer { path: P, ) -> Result>, AssetServerError> { path.as_ref() - .extension() - .and_then(|e| e.to_str()) + .to_str() + .and_then(|s| s.find('.').map(|x| &s[x + 1..])) .ok_or(AssetServerError::MissingAssetLoader(None)) .and_then(|extension| self.get_asset_loader(extension)) }