We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2d2011 commit f9616cfCopy full SHA for f9616cf
src/c_string.rs
@@ -119,8 +119,6 @@ impl<const N: usize> CString<N> {
119
/// Converts the [`CString`] to a [`CStr`] slice.
120
#[inline]
121
pub fn as_c_str(&self) -> &CStr {
122
- debug_assert!(CStr::from_bytes_with_nul(&self.inner).is_ok());
123
-
124
unsafe { CStr::from_bytes_with_nul_unchecked(&self.inner) }
125
}
126
@@ -261,8 +259,6 @@ impl<const N: usize> CString<N> {
261
259
/// ```
262
260
263
pub fn as_bytes(&self) -> &[u8] {
264
- debug_assert_eq!(self.inner.last().copied(), Some(0));
265
266
&self.inner[..self.inner.len() - 1]
267
268
0 commit comments