Skip to content

Commit e69ede3

Browse files
Add doc(cfg) to read_from_io and write_to_io (#2786)
Added `#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]` to `FromBytes::read_from_io` and `IntoBytes::write_to_io` in `src/lib.rs` to ensure feature requirements are visible in the documentation. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent ec1bc1f commit e69ede3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4665,6 +4665,7 @@ pub unsafe trait FromBytes: FromZeros {
46654665
/// let header = BitmapFileHeader::read_from_io(&mut file).unwrap();
46664666
/// ```
46674667
#[cfg(feature = "std")]
4668+
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
46684669
#[inline(always)]
46694670
fn read_from_io<R>(mut src: R) -> io::Result<Self>
46704671
where
@@ -5401,6 +5402,7 @@ pub unsafe trait IntoBytes {
54015402
/// assert_eq!(dst, [255, 255]);
54025403
/// ```
54035404
#[cfg(feature = "std")]
5405+
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
54045406
#[inline(always)]
54055407
fn write_to_io<W>(&self, mut dst: W) -> io::Result<()>
54065408
where

0 commit comments

Comments
 (0)