-
Notifications
You must be signed in to change notification settings - Fork 105
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 pseudocode to document transmute
, transmute_mut
#1058
Conversation
src/lib.rs
Outdated
/// Src: IntoBytes, | ||
/// Dst: FromBytes, | ||
/// size_of::<Src>() == size_of::<Dst>(), | ||
/// align_of::<Src>() >= align_of::<Dst>(), |
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.
/// align_of::<Src>() >= align_of::<Dst>(), |
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.
Done
src/lib.rs
Outdated
/// Src: IntoBytes + FromBytes + NoCell, | ||
/// Dst: FromBytes + IntoBytes + NoCell, |
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.
/// Src: IntoBytes + FromBytes + NoCell, | |
/// Dst: FromBytes + IntoBytes + NoCell, | |
/// Src: FromBytes + IntoBytes + NoCell, | |
/// Dst: FromBytes + IntoBytes + NoCell, |
IMO it's visually clearer this way that both types must implement the same set of traits.
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.
Done
src/lib.rs
Outdated
/// Src: IntoBytes + FromBytes + NoCell, | ||
/// Dst: IntoBytes + FromBytes + NoCell, |
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.
/// Src: IntoBytes + FromBytes + NoCell, | |
/// Dst: IntoBytes + FromBytes + NoCell, | |
/// Src: FromBytes + IntoBytes + NoCell, | |
/// Dst: FromBytes + IntoBytes + NoCell, |
Usually we list FromBytes
before IntoBytes
, consistent w/ the stdlib From
and Into
. I don't feel strongly about it, though, so feel free to leave it as-is if you prefer.
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.
Fair enough. Done.
Partially addresses #1046.
Partially addresses #1046.