mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-27 12:30:35 +00:00
Remove debug assertions
This commit is contained in:
parent
b2d201167c
commit
f9616cf5bb
@ -119,8 +119,6 @@ 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());
|
||||
|
||||
unsafe { CStr::from_bytes_with_nul_unchecked(&self.inner) }
|
||||
}
|
||||
|
||||
@ -261,8 +259,6 @@ impl<const N: usize> CString<N> {
|
||||
/// ```
|
||||
#[inline]
|
||||
pub fn as_bytes(&self) -> &[u8] {
|
||||
debug_assert_eq!(self.inner.last().copied(), Some(0));
|
||||
|
||||
&self.inner[..self.inner.len() - 1]
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user