mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-29 21:40:27 +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.
|
/// Converts the [`CString`] to a [`CStr`] slice.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn as_c_str(&self) -> &CStr {
|
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) }
|
unsafe { CStr::from_bytes_with_nul_unchecked(&self.inner) }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,8 +259,6 @@ impl<const N: usize> CString<N> {
|
|||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn as_bytes(&self) -> &[u8] {
|
pub fn as_bytes(&self) -> &[u8] {
|
||||||
debug_assert_eq!(self.inner.last().copied(), Some(0));
|
|
||||||
|
|
||||||
&self.inner[..self.inner.len() - 1]
|
&self.inner[..self.inner.len() - 1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user