Skip to content
Commit 4951ddd5 authored by Yutaro Ohno's avatar Yutaro Ohno Committed by Miguel Ojeda
Browse files

rust: str: implement `Display` and `Debug` for `BStr`



Currently, `BStr` is just a type alias of `[u8]`, limiting its
representation to a byte list rather than a character list, which is not
ideal for printing and debugging.

Implement `Display` and `Debug` traits for `BStr` to facilitate easier
printing and debugging.

Also, for this purpose, change `BStr` from a type alias of `[u8]` to a
struct wrapper of `[u8]`.

Co-developed-by: default avatarVirgile Andreani <armavica@ulminfo.fr>
Signed-off-by: default avatarVirgile Andreani <armavica@ulminfo.fr>
Signed-off-by: default avatarYutaro Ohno <yutaro.ono.418@gmail.com>
Reviewed-by: default avatarAlice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/ZcSlGMGP-e9HqybA@ohnotp
[ Formatted code comment. ]
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent 1b6170ff
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment