Skip to content

Commit

Permalink
clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Nov 27, 2024
1 parent 348f046 commit 1db9f8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions framework/base/src/types/managed/wrapped/managed_vec_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ pub trait ManagedVecItem: 'static {
fn into_byte_writer<R, Writer: FnMut(&[u8]) -> R>(self, writer: Writer) -> R;
}

/// Used by the ManagedVecItem derive.
///
/// ## Safety
///
/// Only works correctly if the given index is correct, otherwise undefined behavior is possible.
pub unsafe fn managed_vec_item_read_from_payload_index<T, P>(payload: &P, index: &mut usize) -> T
where
T: ManagedVecItem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ pub trait ManagedVecItemPayload {

fn payload_slice_mut(&mut self) -> &mut [u8];

/// Takes a sub-payload item.
///
/// ## Safety
///
/// Only works correctly if the given index is correct, otherwise undefined behavior is possible.
unsafe fn slice_unchecked<S: ManagedVecItemPayload>(&self, index: usize) -> &S;
}

Expand Down

0 comments on commit 1db9f8e

Please sign in to comment.