Update src/c_string.rs

Co-authored-by: Markus Reiter <me@reitermark.us>
This commit is contained in:
Yota Toyama 2025-04-11 06:43:28 +08:00 committed by GitHub
parent 503262218f
commit abec9e3783
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -118,6 +118,7 @@ impl<const N: usize> CString<N> {
}
/// Converts the [`CString`] to a [`CStr`] slice.
#[inline]
pub fn as_c_str(&self) -> &CStr {
debug_assert!(CStr::from_bytes_with_nul(&self.inner).is_ok());