Re: [PATCH v4 26/28] rust: str: test: replace `alloc::format`

Alice Ryhl
2024-08-07T13:51:37Z

On Mon, Aug 5, 2024 at 5:22 PM Danilo Krummrich <dakr@kernel.org> wrote:
>
> The current implementation of tests in str.rs use `format!` to format
> strings for comparison, which, internally, creates a new `String`.
>
> In order to prepare for getting rid of Rust's alloc crate, we have to
> cut this dependency. Instead, implement `format!` for `CString`.
>
> Note that for userspace tests, `Kmalloc`, which is backing `CString`'s
> memory, is just a type alias to `Cmalloc`.
>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>

Reviewed-by: Alice Ryhl <aliceryhl@google.com>