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

#1994 - Support for iterating enabled image formats #2038

Merged
merged 3 commits into from
Oct 24, 2023

Conversation

xweskingx
Copy link

@xweskingx xweskingx commented Oct 24, 2023

Add functions to enumerate all ImageFormat, and determine availability based on configured feature flags.

Example Usage:

let available_extensions = ImageFormat::all()
            .filter(ImageFormat::reading_enabled)
            .flat_map(ImageFormat::extensions_str)
            .collect();

@fintelia
Copy link
Contributor

Looks like there's a few clippy issues. Specifically, the all() method needs to be marked pub and there's a few instances of assert_eq!(false, ...) that can be simplified to assert!(!...).

@fintelia fintelia merged commit 6dbfe75 into image-rs:master Oct 24, 2023
35 checks passed
@fintelia
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants