Skip to content

Commit a7cfa93

Browse files
gyscosclaude
andcommitted
Keep the std gate on the Cursor WriteBuf impl
681bcc3 added cursor_position() directly above the impl, between it and its #[cfg(feature = "std")], so the attribute landed on the new function and the impl was left ungated. Building zstd-safe without the std feature then failed on `std::io::Cursor`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TeZDBS4Uw5kdF77tkJ7cAe
1 parent 9bf1692 commit a7cfa93

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎zstd-safe/src/lib.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,8 +1650,6 @@ pub unsafe trait WriteBuf {
16501650
}
16511651
}
16521652

1653-
#[cfg(feature = "std")]
1654-
#[cfg_attr(feature = "doc-cfg", doc(cfg(feature = "std")))]
16551653
/// The position of a `Cursor`, as an index into the buffer it wraps.
16561654
///
16571655
/// `Cursor` stores the position as a `u64` and lets it be set anywhere, so on a
@@ -1666,6 +1664,8 @@ fn cursor_position<T>(cursor: &std::io::Cursor<T>) -> usize {
16661664
usize::try_from(cursor.position()).unwrap_or(usize::MAX)
16671665
}
16681666

1667+
#[cfg(feature = "std")]
1668+
#[cfg_attr(feature = "doc-cfg", doc(cfg(feature = "std")))]
16691669
unsafe impl<T> WriteBuf for std::io::Cursor<T>
16701670
where
16711671
T: WriteBuf,

0 commit comments

Comments
 (0)