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

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

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

dzfrias
Copy link
Contributor

@dzfrias dzfrias commented Jun 28, 2024

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.

This is an API improvement to make it clear to users that most of the
methods on `DynamicImage` are non-mutating.
Copy link
Member

@HeroicKatora HeroicKatora left a comment

Choose a reason for hiding this comment

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

That's cool, this change aligns them with string modification in the standard library.

@kornelski kornelski merged commit 4589a4a into image-rs:main Jun 28, 2024
30 of 32 checks passed
@dzfrias dzfrias deleted the must_use branch June 28, 2024 13:00
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.

None yet

3 participants