-
Notifications
You must be signed in to change notification settings - Fork 2
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
|
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>>, } ```
Hi @rikhuijzer I opened a small PR to address one of the getter/setter changes mentioned in this issue. I'm new to Rust but let me know if this PR is helpful and I can dive into the rest of the getter/setter updates. |
Yes thank you for the PR. I'm currently having some other priorities but happily merge PRs! Thank you for taking a look |
This commit removes the getter and setter methods for print_ir_before_all and makes the print_ir_before_all field public. It also removes the setter method for write and makes the writer field public. Reference to issue #44
This commit removes the value getter/setter methods and makes the value field public. It also updates all previous usage of the getter/setter. References issue rikhuijzer#44
This commit removes the value getter/setter methods and makes the value field public. It also updates all previous usage of the getter/setter. References issue #44
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: