rust: str: add `b_str!` macro
authorGary Guo <gary@garyguo.net>
Thu, 10 Nov 2022 16:41:27 +0000 (17:41 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 4 Dec 2022 00:59:15 +0000 (01:59 +0100)
commit650ec51561fd201bcf47ce9b1d9b6fedd4bb60a6
tree6ecbba36daeb21d8ede719688995c7205e17f8ba
parent7c5977464681c2ec603efcac32a9432bcd355f12
rust: str: add `b_str!` macro

Add the `b_str!` macro, which creates a new `BStr` from
a string literal.

It is usable in const contexts, for instance:

    const X: &BStr = b_str!("Example");

Signed-off-by: Gary Guo <gary@garyguo.net>
[Reworded, adapted for upstream and applied latest changes]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/str.rs