diff --git a/src/main.rs b/src/main.rs index b977677..0b3f624 100644 --- a/src/main.rs +++ b/src/main.rs @@ -104,7 +104,7 @@ struct WhisperService { jobs: std::sync::mpsc::SyncSender, } -fn new_whisper_service(model_path: String, threads: i32, stream_head: f32, stream_tail: f32, handler_fn: fn(Result<&Whispered, String>)) -> Result { +fn new_whisper_service(model_path: String, threads: i32, stream_head: f32, stream_tail: f32, handler_fn: fn(Result)) -> Result { match new_whisper_engine(model_path, threads) { Ok(engine) => { let whisper = new_whisper_impl(engine, stream_head, stream_tail, handler_fn); @@ -142,10 +142,10 @@ struct WhisperImpl { engine: WhisperEngine, stream_head: f32, stream_tail: f32, - handler_fn: fn(Result<&Whispered, String>), + handler_fn: fn(Result), } -fn new_whisper_impl(engine: WhisperEngine, stream_head: f32, stream_tail: f32, handler_fn: fn(Result<&Whispered, String>)) -> WhisperImpl { +fn new_whisper_impl(engine: WhisperEngine, stream_head: f32, stream_tail: f32, handler_fn: fn(Result)) -> WhisperImpl { WhisperImpl { engine: engine, stream_head: stream_head, @@ -189,7 +189,7 @@ impl WhisperImpl { let result = whispered .after(&(self.stream_head * 100.0)) .before(&(self.stream_tail * 100.0)); - (self.handler_fn)(Ok(&result)); + (self.handler_fn)(Ok(result)); } fn on_error(&self, msg: String) {