diff options
| author | Alice Ryhl <[email protected]> | 2025-05-02 13:19:32 +0000 |
|---|---|---|
| committer | Danilo Krummrich <[email protected]> | 2025-05-07 16:39:22 +0000 |
| commit | 088bf14a886e1e746c961a862ebccbb76d7cbd4e (patch) | |
| tree | 4d3bc92e782cc77eb92f52d43a9247c0b0e2b3de /scripts/rustdoc_test_builder.rs | |
| parent | rust: alloc: add Vec::push_within_capacity (diff) | |
| download | kernel-088bf14a886e1e746c961a862ebccbb76d7cbd4e.tar.gz kernel-088bf14a886e1e746c961a862ebccbb76d7cbd4e.zip | |
rust: alloc: add Vec::drain_all
This is like the stdlib method drain, except that it's hard-coded to use
the entire vector's range. Rust Binder uses it in the range allocator to
take ownership of everything in a vector in a case where reusing the
vector is desirable.
Implementing `DrainAll` in terms of `slice::IterMut` lets us reuse some
nice optimizations in core for the case where T is a ZST.
Signed-off-by: Alice Ryhl <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Reviewed-by: Benno Lossin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Danilo Krummrich <[email protected]>
Diffstat (limited to 'scripts/rustdoc_test_builder.rs')
0 files changed, 0 insertions, 0 deletions
