Skip to content

Conversation

@jswrenn
Copy link
Collaborator

@jswrenn jswrenn commented Feb 29, 2024

Makes progress towards #5.

@jswrenn jswrenn requested a review from joshlf February 29, 2024 20:45
src/lib.rs Outdated
///
/// WARNING: Do not implement this trait yourself! Instead, use
/// `#[derive(TryFromBytes)]`.
/// This derive synthesizes the runtime checks required to check if a sequence
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// This derive synthesizes the runtime checks required to check if a sequence
/// This derive synthesizes the runtime checks required to check whether a sequence

Copy link
Collaborator Author

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
/// Types for which some bit patterns are valid.
///
/// A memory region of the appropriate length which contains initialized bytes
/// can be viewed as a `TryFromBytes` type so long as the runtime value of bytes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// can be viewed as a `TryFromBytes` type so long as the runtime value of bytes
/// can be viewed as a `TryFromBytes` type so long as the runtime value of those bytes

Copy link
Collaborator Author

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
/// A memory region of the appropriate length which contains initialized bytes
/// can be viewed as a `TryFromBytes` type so long as the runtime value of bytes
/// correspond to a [*valid instance*] of that type. For example, [`bool`] is
/// `TryFromBytes`; zerocopy can transmute a [`bool`] into a [`u8`] so long as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// `TryFromBytes`; zerocopy can transmute a [`bool`] into a [`u8`] so long as
/// `TryFromBytes`; zerocopy can transmute a [`u8`] into a [`bool`] so long as

Also, this isn't technically true in our API (right now). We don't have try_transmute!, so we can't actually do this. Maybe say something like "zerocopy can transmute a [u8] into a bool..."?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Makes progress towards #5.
@jswrenn jswrenn requested a review from joshlf February 29, 2024 21:17
@joshlf joshlf enabled auto-merge February 29, 2024 21:19
@joshlf joshlf added this pull request to the merge queue Feb 29, 2024
Merged via the queue into main with commit cac291e Feb 29, 2024
@joshlf joshlf deleted the doc-tryfrombytes branch February 29, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants