Skip to content

Commit

Permalink
Add non-slice Ref constructors w/ slice elem count
Browse files Browse the repository at this point in the history
Add `Ref` constructors which are generic over `T:
KnownLayout<PointerMetadata = usize>` - in other words, types whose
trailing field is a slice (i.e., slices or slice DSTs). These
constructors take an explicit element count for the trailing slice, and
replace the previous constructors which only supported slices.

Makes progress on #29
  • Loading branch information
joshlf committed Apr 18, 2024
1 parent 6100500 commit ab25c82
Show file tree
Hide file tree
Showing 2 changed files with 177 additions and 127 deletions.
1 change: 1 addition & 0 deletions src/deprecated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ where
T: NoCell,
{
#[deprecated(since = "0.8.0", note = "`Ref::new_zeroed` now supports slices")]
#[must_use]
#[doc(hidden)]
#[inline(always)]
pub fn new_slice_zeroed(bytes: B) -> Option<Ref<B, [T]>> {
Expand Down
Loading

0 comments on commit ab25c82

Please sign in to comment.