Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
framing_sv2
#848Rust Docs
framing_sv2
#848Changes from all commits
28966c9
718614d
0b75cc6
02ee50a
6cb1daf
256697c
a6f573b
3504cf8
b714fd8
0fd8743
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Note for the future, it could make sense to return a type that encode the above infos: enum Ok, Bigger, Smaller. This would be an API change so for now I would live it like it is
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.
Can we add a warning here that is printed when compiled? So you have to explicitly opt out from it when you want to use this function?
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.
sorry @Fi3 I don't fully understand the suggestion
I did some research but couldn't find an easy way to print a warning during compilation.
I only found this pre-RFC which proposes a
compile_warning!
macro but it will probably take a long time before this is available.Do you have some examples on how to achieve this?
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.
No I was just supposing that it was already doable on stable, maybe we can leave a comment for our future self.
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.
well, as we already discussed briefly, I believe the
framing_sv2
crate should be refactored in the future.the
Frame
trait is forcingSv2Frame
andHandShakeFrame
to share APIs while they don't really share a lot of common features, and as a consequence we end up with APIs that are inuntuitive and dirty (e.g.: panic on undersired scenarios)so if we're taking a note for the future, I think we should simply refactor this crate (removing the
Frame
trait and re-writing the APIs) so that we don't need to be emitting compilation warnings to avoid footgunsThere 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 wrote a summary of all things to be refactored on
framing_sv2
in the future here:#903