Skip to content

Commit 9ce2b3f

Browse files
committed
change value check to non-debug assert and document
1 parent 9e55295 commit 9ce2b3f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pulse-binding/src/format.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,11 @@ impl Info {
577577
/// Note for PCM: If the channel count is left unspecified in the `Info` object, then the server
578578
/// will select the stream channel count. In that case the stream channel count will most likely
579579
/// match the device channel count, meaning that up/downmixing will be avoided.
580+
///
581+
/// Panics if `channels` is larger than can be submitted to the C function.
580582
#[inline]
581583
pub fn set_channels(&mut self, channels: u32) {
582-
debug_assert!(channels <= std::i32::MAX as u32);
584+
assert!(channels <= std::i32::MAX as u32);
583585
unsafe { capi::pa_format_info_set_channels(self.ptr as *mut capi::pa_format_info,
584586
channels as i32) }
585587
}

0 commit comments

Comments
 (0)