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

feat: Create new method on Param and EventParam #634

Merged
merged 2 commits into from
May 24, 2024

Conversation

quentinv72
Copy link
Contributor

Motivation

Resolve #240

Solution

  • Create a new method for Param and EventParam
  • Annotate the ty and name fields on Param and EventParam with #[doc(hidden)] to discourage users from creating their own isntances of those types wihtout using the new method. The reason for not making those fields private is that they are used by macros in different crates.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@prestwich
Copy link
Member

Thank you, I like this approach

@prestwich prestwich merged commit f5e04aa into alloy-rs:main May 24, 2024
27 of 30 checks passed
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.

Prevent user from instantiating invalid Param instances by making at least 1 field private
2 participants