Roughsketch / imagesize

Quickly probe the size of various image formats without reading the entire file.
MIT License
57 stars 12 forks source link

Mark `ImageType` as `#[non_exhaustive]` #39

Closed kovaxis closed 2 months ago

kovaxis commented 2 months ago

First of all, great crate!

I was just reading through the documentation, and it looks like adding a new image format is a breaking change, because of the ImageType enum. Marking it as #[non_exhaustive] would allow this crate to add new formats with only a patch bump (ie. 0.12.0 -> 0.12.1). The ImageType enum is almost the exact kind of enum that #[non_exhaustive] was designed for.

This would allow all users of this crate to get new image format support "for free" (without any manual intervention other than refreshing the Cargo.lock file).

Roughsketch commented 2 months ago

Thanks for the suggestion! I haven't heard of this before, but it does look promising. I'll look into adding it to 0.13.0, just need to make sure it doesn't break anything that I'm aware of.

Roughsketch commented 2 months ago

Added in #40