Skip to content

Commit f9616cf

Browse files
committed
Remove debug assertions
1 parent b2d2011 commit f9616cf

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/c_string.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ impl<const N: usize> CString<N> {
119119
/// Converts the [`CString`] to a [`CStr`] slice.
120120
#[inline]
121121
pub fn as_c_str(&self) -> &CStr {
122-
debug_assert!(CStr::from_bytes_with_nul(&self.inner).is_ok());
123-
124122
unsafe { CStr::from_bytes_with_nul_unchecked(&self.inner) }
125123
}
126124

@@ -261,8 +259,6 @@ impl<const N: usize> CString<N> {
261259
/// ```
262260
#[inline]
263261
pub fn as_bytes(&self) -> &[u8] {
264-
debug_assert_eq!(self.inner.last().copied(), Some(0));
265-
266262
&self.inner[..self.inner.len() - 1]
267263
}
268264
}

0 commit comments

Comments
 (0)