Skip to content

Commit 9fd4085

Browse files
docs: add Panics section to codec_name_to_cstring doc comment
Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
1 parent 447ee35 commit 9fd4085

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sdks/plugin-sdk/native/src/conversions.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ pub const fn raw_video_format_from_c(cfmt: &CRawVideoFormat) -> RawVideoFormat {
194194
///
195195
/// Codec names are compile-time ASCII constants that never contain interior
196196
/// null bytes, so `CString::new` cannot fail here.
197+
///
198+
/// # Panics
199+
///
200+
/// Panics if `name` contains an interior null byte. This is a programmer
201+
/// error — `as_c_name()` values are controlled constants that never contain
202+
/// null bytes.
197203
#[allow(clippy::expect_used)] // as_c_name() returns controlled constants; null bytes are a programmer error
198204
pub fn codec_name_to_cstring(name: &str) -> CString {
199205
CString::new(name).expect("codec name from as_c_name() must not contain null bytes")

0 commit comments

Comments
 (0)