diff options
author | Danilo Krummrich <dakr@kernel.org> | 2024-10-04 17:41:30 +0200 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2024-10-15 23:10:32 +0200 |
commit | eb6f92cd3f755c179204ea1f933b07cf992892fd (patch) | |
tree | c178f01adbda2b89e5de043494864b922c276ee0 /scripts/generate_rust_analyzer.py | |
parent | dd09538fb4093176a818fcecd45114430cc5840f (diff) | |
download | lwn-eb6f92cd3f755c179204ea1f933b07cf992892fd.tar.gz lwn-eb6f92cd3f755c179204ea1f933b07cf992892fd.zip |
rust: str: test: replace `alloc::format`
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`.
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20241004154149.93856-27-dakr@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions