Skip to content

Commit

Permalink
Add as_mut_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jan 11, 2024
1 parent 393f6ab commit fcc9289
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions foreign-types-shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,10 @@ pub unsafe trait ForeignTypeRef: Sized {
fn as_ptr(&self) -> *mut Self::CType {
self as *const _ as *mut _
}

/// Returns a raw pointer to the wrapped value.
#[inline]
fn as_mut_ptr(&mut self) -> *mut Self::CType {
self as *mut _ as *mut _
}
}

0 comments on commit fcc9289

Please sign in to comment.