Skip to content

Commit d435b54

Browse files
committed
Fix capacity in doc test
1 parent a355e66 commit d435b54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/c_string.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ impl<const N: usize> CString<N> {
6868
/// ```rust
6969
/// use heapless::CString;
7070
/// let mut c_string =
71-
/// unsafe { CString::<5>::from_bytes_with_nul_unchecked(b"c_string\0").unwrap() };
71+
/// unsafe { CString::<7>::from_bytes_with_nul_unchecked(b"string\0").unwrap() };
7272
///
73-
/// assert_eq!(c_string.to_str(), Ok("c_string"));
73+
/// assert_eq!(c_string.to_str(), Ok("string"));
7474
/// ```
7575
pub unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> Result<Self, CapacityError> {
7676
let mut inner = Vec::new();

0 commit comments

Comments
 (0)