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

Mark methods from operations API as #[must_use] where appropriate #1934

Merged
merged 5 commits into from
Jul 11, 2023

Conversation

hannobraun
Copy link
Owner

Objects are immutable, and thus the operations API creates new objects instead of modifying existing ones. This can be error-prone, as it is not necessarily clear to someone using the API for the first time.

This pull request addresses this issue, by adding #[must_use] to all the appropriate methods, leading to a warning if the return value is not used.

@hannobraun hannobraun enabled auto-merge July 11, 2023 07:43
@hannobraun hannobraun merged commit 3bcb450 into main Jul 11, 2023
@hannobraun hannobraun deleted the must_use branch July 11, 2023 07:47
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.

1 participant