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

0.15 migration guide provides incorrect advice about AssetLoader #1896

Open
spectria-limina opened this issue Dec 2, 2024 · 1 comment
Open
Labels
A-Migration Guides C-Correction A typo, problem or factual issue in what we've written
Milestone

Comments

@spectria-limina
Copy link

The migration guide for 0.15 suggests that a prototypical implementation of AssetLoader now looks like this:

impl AssetLoader for MyLoader {
    async fn load<'a>(
        &'a self,
        reader: &'a mut dyn bevy::asset::io::Reader,
        _: &'a Self::Settings,
        load_context: &'a mut LoadContext<'_>,
    ) -> Result<Self::Asset, Self::Error> {
}

However, this is incorrect: the lifetimes are not constrained in the trait to all be equal. The correct implementation is:

impl AssetLoader for MyLoader {
    async fn load(
        &self,
        reader: &mut dyn bevy::asset::io::Reader,
        _: &Self::Settings,
        load_context: &mut LoadContext<'_>,
    ) -> Result<Self::Asset, Self::Error> {
}
@spectria-limina spectria-limina added the C-Docs Documentation for the code of the website label Dec 2, 2024
@alice-i-cecile alice-i-cecile transferred this issue from bevyengine/bevy Dec 2, 2024
@alice-i-cecile alice-i-cecile added A-Migration Guides C-Correction A typo, problem or factual issue in what we've written and removed C-Docs Documentation for the code of the website labels Dec 2, 2024
@alice-i-cecile alice-i-cecile added this to the Release v0.15 milestone Dec 2, 2024
@rparrett
Copy link
Contributor

rparrett commented Dec 2, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Migration Guides C-Correction A typo, problem or factual issue in what we've written
Projects
None yet
Development

No branches or pull requests

3 participants