image-rs / image

Encoding and decoding images in Rust
Apache License 2.0
4.86k stars 597 forks source link

Add `#[must_use]` attribute to some `DynamicImage` methods #2268

Closed dzfrias closed 2 months ago

dzfrias commented 2 months ago

Hello! Thanks for maintaining such a helpful crate. This PR is a small API improvement to make it clear to users that most of the methods on DynamicImage are non-mutating. #1736 along with my own usage of this crate suggest that it would be helpful to make these methods #[must_use].

Let me know if there's some reason that we're not using #[must_use] already, and if there are some methods that warrant or don't warrant being marked with this attribute.

I license past and future contributions under the dual MIT/Apache-2.0 license, allowing licensees to choose either at their option.