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

Please re-export IntoDynamicImageError as public #13222

Closed
stinkytoe opened this issue May 3, 2024 · 2 comments
Closed

Please re-export IntoDynamicImageError as public #13222

stinkytoe opened this issue May 3, 2024 · 2 comments
Labels
A-Rendering Drawing game state to the screen C-Usability A simple quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! X-Uncontroversial This work is generally agreed upon

Comments

@stinkytoe
Copy link
Contributor

What problem does this solve or what need does it fill?

When working with image data directly, it's useful to use try_into_dynamic(...) to get a dynamic image to use with the image crate. While try_into_dynamic is public, it returns a Result<DynamicImage, IntoDynamicImageError>, and IntoDynamicImageError is not re_exported publicly. Though declared public, it's defined in image_texture_conversion.rs which is of pub(crate) visibility.

I can still use .unwrap() or .expect() or match ..., but I can't implement .from(...) for another error type, such as a thiserror style error.

What solution would you like?

Please re-export IntoDynamicImageError as public.

What alternative(s) have you considered?

For now I'm using match to decompose the error, printing using the error!(...) macro, and explicitly returning my own error variant.

Additional context

Hopefully it's something small!

@stinkytoe stinkytoe added C-Enhancement A new feature S-Needs-Triage This issue needs to be labelled labels May 3, 2024
@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy A-Rendering Drawing game state to the screen C-Usability A simple quality-of-life change that makes Bevy easier to use X-Uncontroversial This work is generally agreed upon S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! and removed C-Enhancement A new feature S-Needs-Triage This issue needs to be labelled labels May 3, 2024
@alice-i-cecile
Copy link
Member

I'd happily merge a PR to this effect.

github-merge-queue bot pushed a commit that referenced this issue May 4, 2024
# Objective

in response to [13222](#13222)

## Solution

The Image trait was already re-exported in bevy_render/src/lib.rs, So I
added it inline there.

## Testing

Confirmed that it does compile. Simple change, shouldn't cause any
bugs/regressions.
@s-puig
Copy link
Contributor

s-puig commented May 9, 2024

@alice-i-cecile I believe this should be closed.

@mockersf mockersf closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Usability A simple quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! X-Uncontroversial This work is generally agreed upon
Projects
None yet
Development

No branches or pull requests

4 participants