Skip to content
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

Add FromBytes::read_from_io and IntoBytes::write_to_io #2016

Open
wants to merge 1 commit into
base: v0.8.x
Choose a base branch
from
Open

Conversation

jswrenn
Copy link
Collaborator

@jswrenn jswrenn commented Nov 4, 2024

Makes progress on #158.

@jswrenn jswrenn requested a review from joshlf November 4, 2024 21:23
src/lib.rs Outdated
@@ -4525,6 +4529,24 @@ pub unsafe trait FromBytes: FromZeros {
}
}

/// TODO
Copy link
Member

Choose a reason for hiding this comment

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

TODO: Doc comment

src/lib.rs Outdated
@@ -5188,6 +5210,16 @@ pub unsafe trait IntoBytes {
Ok(())
}

/// TODO
Copy link
Member

Choose a reason for hiding this comment

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

TODO: Doc comment

Copy link
Member

Choose a reason for hiding this comment

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

TODO: Tests

@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.64%. Comparing base (1fb6365) to head (c38fc1f).
Report is 3 commits behind head on v0.8.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           v0.8.x    #2016      +/-   ##
==========================================
+ Coverage   87.59%   87.64%   +0.05%     
==========================================
  Files          16       16              
  Lines        5988     6016      +28     
==========================================
+ Hits         5245     5273      +28     
  Misses        743      743              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
///
/// # Examples
///
/// ```no_run
Copy link
Member

Choose a reason for hiding this comment

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

If you want this to run, you could use a trick like we do here:

/// ```rust

///
/// # Examples
///
/// ```no_run
Copy link
Member

Choose a reason for hiding this comment

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

If you want this to run, you could use a trick like we do here:

/// ```rust

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think there's much sense in actually testing the IO. It'll make our tests more expensive to run, and will cause them to fail on platforms where file IO is stubbed out (e.g., wasm).

src/lib.rs Outdated Show resolved Hide resolved
Comment on lines +5238 to +5236
/// This is a shorthand for `dst.write_all(self.as_bytes())`, and is useful
/// for interfacing with operating system byte sinks (files, sockets, etc.).
Copy link
Member

Choose a reason for hiding this comment

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

Same here - IMO we should remove the mention of OS byte sinks.

src/lib.rs Outdated Show resolved Hide resolved
Makes progress on #158.

Co-authored-by: Joshua Liebow-Feeser <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants