Skip to content

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

Merged
hannobraun merged 5 commits into
mainfrom
must_use
Jul 11, 2023
Merged

Mark methods from operations API as #[must_use] where appropriate#1934
hannobraun merged 5 commits into
mainfrom
must_use

Conversation

@hannobraun
Copy link
Copy Markdown
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