Skip to content

Commit 8cfce47

Browse files
Valentin Obstojeda
authored andcommitted
rust: str: use NUL instead of 0 in doc comments
Throughout the module, bytes with the value zero are referred to as `NUL` bytes. Adapt the only two outliers. Signed-off-by: Valentin Obst <[email protected]> Reviewed-by: Trevor Gross <[email protected]> Reviewed-by: Martin Rodriguez Reboredo <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent ed85965 commit 8cfce47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rust/kernel/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ impl CStr {
149149
self.0.as_ptr() as _
150150
}
151151

152-
/// Convert the string to a byte slice without the trailing 0 byte.
152+
/// Convert the string to a byte slice without the trailing `NUL` byte.
153153
#[inline]
154154
pub fn as_bytes(&self) -> &[u8] {
155155
&self.0[..self.len()]
156156
}
157157

158-
/// Convert the string to a byte slice containing the trailing 0 byte.
158+
/// Convert the string to a byte slice containing the trailing `NUL` byte.
159159
#[inline]
160160
pub const fn as_bytes_with_nul(&self) -> &[u8] {
161161
&self.0

0 commit comments

Comments
 (0)