rust: str: add `fmt!` macro
authorWedson Almeida Filho <wedsonaf@gmail.com>
Thu, 10 Nov 2022 16:41:34 +0000 (17:41 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 4 Dec 2022 00:59:16 +0000 (01:59 +0100)
commitef32054942ee8d78cbcc2c97212e55b6f5f668f7
tree8f559e3e167e3a738af52e38f8b9245e9a7e09c8
parent65e1e497f6d63f747d453b3d89fbeb6d140cbbb7
rust: str: add `fmt!` macro

Add the `fmt!` macro, which is a convenience alias for the Rust
`core::format_args!` macro.

For instance, it may be used to create a `CString`:

    CString::try_from_fmt(fmt!("{}{}", "abc", 42))?

Signed-off-by: Wedson Almeida Filho <wedsonaf@gmail.com>
Reviewed-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