Skip to content

Commit

Permalink
refactor(errors) : rename AcceptWaveformError::BufferTooBig
Browse files Browse the repository at this point in the history
  • Loading branch information
Bear-03 committed Oct 27, 2024
1 parent fae87c4 commit 08c3951
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/vosk/src/recognition/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl BatchRecognizer {
vosk_batch_recognizer_accept_waveform(
self.0.as_ptr(),
data.as_ptr(),
i32::try_from(len).map_err(|_| AcceptWaveformError::BufferTooBig(len))?,
i32::try_from(len).map_err(|_| AcceptWaveformError::BufferTooLong(len))?,
)
};

Expand Down
2 changes: 1 addition & 1 deletion crates/vosk/src/recognition/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ pub enum AcceptWaveformError {
"the length of the provided audio buffer was {0} (expected < {})",
i32::MAX
)]
BufferTooBig(usize),
BufferTooLong(usize),
}
2 changes: 1 addition & 1 deletion crates/vosk/src/recognition/sequential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl Recognizer {
vosk_recognizer_accept_waveform_s(
self.0.as_ptr(),
data.as_ptr(),
i32::try_from(len).map_err(|_| AcceptWaveformError::BufferTooBig(len))?,
i32::try_from(len).map_err(|_| AcceptWaveformError::BufferTooLong(len))?,
)
};

Expand Down

0 comments on commit 08c3951

Please sign in to comment.