Skip to main content

to_cstring_lossy

Function to_cstring_lossy 

Source
fn to_cstring_lossy(s: &str, fallback: &str) -> CString
Expand description

Convert a &str to a CString, falling back to fallback on interior NUL bytes.

Used internally by make_rust_condition_value to avoid duplicating the CString::new(s).unwrap_or_else(…) pattern across every slot.