]> www.infradead.org Git - users/hch/misc.git/commit
rust: str: introduce `NullTerminatedFormatter`
authorAndreas Hindborg <a.hindborg@kernel.org>
Tue, 2 Sep 2025 09:54:58 +0000 (11:54 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Sep 2025 11:23:56 +0000 (05:23 -0600)
commitcdde7a1951ff0600adc45718ba251559e4d3fd7c
treef8f4d0925b590b6b4cb49dbd5af1b26d2f46c1e7
parent8c5ac71cf19bc8a2ad5bc905d1fd3191d887d469
rust: str: introduce `NullTerminatedFormatter`

Add `NullTerminatedFormatter`, a formatter that writes a null terminated
string to an array or slice buffer. Because this type needs to manage the
trailing null marker, the existing formatters cannot be used to implement
this type.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Link: https://lore.kernel.org/r/20250902-rnull-up-v6-16-v7-4-b5212cc89b98@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
rust/kernel/str.rs