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] - Export anyhow::error for custom asset loaders #5359

Closed
wants to merge 2 commits into from

Conversation

sarkahn
Copy link
Contributor

@sarkahn sarkahn commented Jul 17, 2022

If users try to implement a custom asset loader, they must manually import anyhow::error as it's used by the asset loader trait but not exported.

) -> BoxedFuture<'a, Result<(), anyhow::Error>> {

Fixes #3138

@alice-i-cecile alice-i-cecile added A-Assets Load files from disk to use for things like images, models, and sounds C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Jul 17, 2022
@alice-i-cecile
Copy link
Member

Ping @djeedai for review (@cart, can you add them to the Github org? I was surprised they weren't there).

Copy link
Member

@mockersf mockersf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also update the example to not depend on anyhow directly but use this reexport instead?

) -> BoxedFuture<'a, Result<(), anyhow::Error>> {

to
) -> BoxedFuture<'a, Result<(), bevy::asset::Error>> {
I would prefer to not import the Error struct directly, so either qualifying it as bevy::asset::Error or asset::Error

@mockersf mockersf added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jul 20, 2022
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jul 20, 2022
If users try to implement a custom asset loader, they must manually import anyhow::error as it's used by the asset loader trait but not exported.

https://github.com/bevyengine/bevy/blob/2b93ab58128178fef64de8134a130f036f07dc5d/examples/asset/custom_asset.rs#L25

Fixes #3138

Co-authored-by: sark <sarkahn@hotmail.com>
@bors bors bot changed the title Export anyhow::error for custom asset loaders [Merged by Bors] - Export anyhow::error for custom asset loaders Jul 20, 2022
@bors bors bot closed this Jul 20, 2022
inodentry pushed a commit to IyesGames/bevy that referenced this pull request Aug 8, 2022
If users try to implement a custom asset loader, they must manually import anyhow::error as it's used by the asset loader trait but not exported.

https://github.com/bevyengine/bevy/blob/2b93ab58128178fef64de8134a130f036f07dc5d/examples/asset/custom_asset.rs#L25

Fixes bevyengine#3138

Co-authored-by: sark <sarkahn@hotmail.com>
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
If users try to implement a custom asset loader, they must manually import anyhow::error as it's used by the asset loader trait but not exported.

https://github.com/bevyengine/bevy/blob/2b93ab58128178fef64de8134a130f036f07dc5d/examples/asset/custom_asset.rs#L25

Fixes bevyengine#3138

Co-authored-by: sark <sarkahn@hotmail.com>
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
If users try to implement a custom asset loader, they must manually import anyhow::error as it's used by the asset loader trait but not exported.

https://github.com/bevyengine/bevy/blob/2b93ab58128178fef64de8134a130f036f07dc5d/examples/asset/custom_asset.rs#L25

Fixes bevyengine#3138

Co-authored-by: sark <sarkahn@hotmail.com>
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-Usability A targeted quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bevy has implicit dependency on anyhow which users need to explicitly add
4 participants