-
Notifications
You must be signed in to change notification settings - Fork 134
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
Rust docs for protocols::v2::const-sv2
#1160
Rust docs for protocols::v2::const-sv2
#1160
Conversation
e97ea55
to
7598bf6
Compare
Bencher Report
Click to view all benchmark results
|
Bencher Report
Click to view all benchmark results
|
Bencher Report
Click to view all benchmark results
|
I took note through normal comments about the constants we will need to remove or modify in the future refactoring.
A final consideration could be to group constants in different modules (Mining Protocol, Job Distribution Protocol, Job Declaration Protocol, Common, Encryption, etc) so that it will be more clear also on https://docs.rs/. But this is debatable and not strictly necessary btw |
Bencher Report
Click to view all benchmark results
|
ecbe5fd
to
4771a06
Compare
from my experience most of the time is more convenient to keep al the constants of a project in a separate module/lib whatever that group them together. |
What do you mean @Fi3? I couldn't fully understand your comment. |
just ignore it, I thought that you were proposing to split the const lib into several libs |
No, I was just thinking about grouping constants into modules, here's an example:
|
Can we use enums for the discriminants? |
In our codebase, we're using some numerical literals directly instead of their corresponding constants. For example, |
@Shourya742 I won't add too many comments regarding refactoring here, since the list I made will be ported to the specific issue (#1135) as soon as this PR get merged. My intention was just to draft something here for now. |
8c7ff08
to
d84c53c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the docs.rs looks a bit weird with all of the constants in the list, but fixing that might require doing breaking changes which are not expected in this pr, so we can skip this for now I guess.
The line widths, specially in the first 3 paragraphs are not consistent, aligning them to 80 or 100 chars per line makes the docs.rs look much better.
d84c53c
to
0232da4
Compare
Aligned to 100 chars here: b873c56. But if I run |
0232da4
to
b873c56
Compare
b873c56
to
a3f7b26
Compare
This PR adds rust docs to
const_sv2
crate.For now it contains a set of comments, which will be resolved after discussions at #1159
Closes #1016