-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use pub
keyword instead of trivial getters and setters
#44
Comments
The way to solve this would be to
|
Repository owner
deleted a comment from
codemechanica
Jan 20, 2025
rikhuijzer
added a commit
that referenced
this issue
Jan 20, 2025
Removes one `Shared` (`Arc`) to simplify the API and replaces trivial getters and setters by `pub` (#44). ```diff pub struct Block { pub label: BlockName, arguments: Values, - ops: Shared<Vec<Shared<dyn Op>>>, + pub ops: Vec<Shared<dyn Op>>, parent: Option<Shared<Region>>, } ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was unsure about whether using the pub keyword on struct fields, like for example,
was a good idea or not. So to be on the safe-side, I decided to keep the fields private and use trivial getter and setter methods instead:
But I recently saw that Wasmtime makes some fields available via the public API. So if it is good enough for Wasmtime it's good enough for me. Let's rewrite all the trivial getters and setters in the library to
pub
fields.The text was updated successfully, but these errors were encountered: