Make WhisperState::new unsafe

This commit is contained in:
Niko 2025-08-13 01:27:28 -07:00
parent 7e46c91cbd
commit 814b2b836f
No known key found for this signature in database
2 changed files with 5 additions and 2 deletions

View file

@ -29,7 +29,10 @@ impl Drop for WhisperState {
}
impl WhisperState {
pub(crate) fn new(
/// # Safety
/// * `ptr` must be non-null
/// * `ptr` must be a valid pointer to a `whisper_state`.
pub(crate) unsafe fn new(
ctx: Arc<WhisperInnerContext>,
ptr: *mut whisper_rs_sys::whisper_state,
) -> Self {