diff --git a/src/c_string.rs b/src/c_string.rs index 6f38d094..8ad0caf5 100644 --- a/src/c_string.rs +++ b/src/c_string.rs @@ -119,8 +119,6 @@ impl CString { /// 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()); - unsafe { CStr::from_bytes_with_nul_unchecked(&self.inner) } } @@ -261,8 +259,6 @@ impl CString { /// ``` #[inline] pub fn as_bytes(&self) -> &[u8] { - debug_assert_eq!(self.inner.last().copied(), Some(0)); - &self.inner[..self.inner.len() - 1] } }