-
Notifications
You must be signed in to change notification settings - Fork 409
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
Ready is Ready-Only, should only have getters. #90
Labels
Enhancement
An improvement to existing code.
Good First Issue
A good issue for a new contributor.
Help Wanted
An issue with unsolved problems, looking for help.
Comments
After adding getter, shall we remove pub modifier? It would be a breaking change then. |
@Ryan-Git |
@siddontang |
bors bot
added a commit
that referenced
this issue
Nov 1, 2018
120: refactor(Ready): add pub getters and make fields private r=Hoverbear a=Ryan-Git Fixes #90 Co-authored-by: renhongdi <[email protected]> Co-authored-by: Ryan-Git <[email protected]>
bors bot
added a commit
that referenced
this issue
Nov 2, 2018
120: refactor(Ready): add pub getters and make fields private r=Hoverbear a=Ryan-Git Fixes #90 Co-authored-by: renhongdi <[email protected]> Co-authored-by: Ryan-Git <[email protected]> Co-authored-by: A. Hobden <[email protected]>
bors bot
added a commit
that referenced
this issue
Nov 2, 2018
120: refactor(Ready): add pub getters and make fields private r=Hoverbear a=Ryan-Git Fixes #90 Co-authored-by: renhongdi <[email protected]> Co-authored-by: Ryan-Git <[email protected]> Co-authored-by: A. Hobden <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Enhancement
An improvement to existing code.
Good First Issue
A good issue for a new contributor.
Help Wanted
An issue with unsolved problems, looking for help.
The
Ready
struct should not allow values to be mutated, it should only provide immutable getters.https://github.com/pingcap/raft-rs/blob/1e0741a9aea3b242d33dadc46245ad611e7e7aa4/src/raw_node.rs#L84-L121
It's possible to do this by writing functions that return immutable borrows of the contained values, or using a crate like https://crates.io/crates/getset which will write them for you.
The text was updated successfully, but these errors were encountered: