diff options
author | Valentin Obst <[email protected]> | 2024-01-31 21:23:27 +0100 |
---|---|---|
committer | Miguel Ojeda <[email protected]> | 2024-02-18 21:22:27 +0100 |
commit | 8cfce47d7598bed0481c8d79437dd572705bb51e (patch) | |
tree | f4e5059667d74ec513b6349ac473bd0795235173 | |
parent | ed8596532a667e1a25ef0293acbb19078b94f686 (diff) |
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]>
-rw-r--r-- | rust/kernel/str.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs index 0a8569594fc3..843ffeec9b3e 100644 --- a/rust/kernel/str.rs +++ b/rust/kernel/str.rs @@ -149,13 +149,13 @@ impl CStr { self.0.as_ptr() as _ } - /// Convert the string to a byte slice without the trailing 0 byte. + /// Convert the string to a byte slice without the trailing `NUL` byte. #[inline] pub fn as_bytes(&self) -> &[u8] { &self.0[..self.len()] } - /// Convert the string to a byte slice containing the trailing 0 byte. + /// Convert the string to a byte slice containing the trailing `NUL` byte. #[inline] pub const fn as_bytes_with_nul(&self) -> &[u8] { &self.0 |