Skip to content

Commit 9f25f29

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 <kernel@valentinobst.de> Reviewed-by: Trevor Gross <tmgross@umich.edu> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20240131-doc-fixes-v3-v3-5-0c8af94ed7de@valentinobst.de Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 7a884ef commit 9f25f29

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)