Upgrading from 0.7 to 0.8: Ref::new_slice
gone?
#1974
-
Hi there, After reading through the upgrading guide in the announcement and searching in the docs, I can't seem to find a method equivalent to 0.7's // (...)
Ok(match Ref::new_slice(&rcrd_bytes[SummaryRecord::SIZE..]) {
Some(data) => data.into_slice(),
None => &{
R::default();
[] as [R; 0]
},
}) Has this functionality been moved to another struct, or has it been removed entirely? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Given a |
Beta Was this translation helpful? Give feedback.
Given a
Ref<[T]>
, bothRef::from_bytes
andRef::into_ref
will work as expected - you no longer need to special-case slices either during construction or when converting to a vanilla reference.