Re: [PATCH v4 26/28] rust: str: test: replace `alloc::format`
From: Alice Ryhl
Date: Wed Aug 07 2024 - 09:51:53 EST
On Mon, Aug 5, 2024 at 5:22 PM Danilo Krummrich <dakr@xxxxxxxxxx> 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@xxxxxxxxxx>
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>