summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc.rs
diff options
context:
space:
mode:
authorWedson Almeida Filho <walmeida@microsoft.com>2024-03-27 22:35:55 -0300
committerMiguel Ojeda <ojeda@kernel.org>2024-04-16 22:03:14 +0200
commit03989773a94490383b062912feb0c4d175f20845 (patch)
tree14df87b69f4c7820ebe8802761496594feae13f0 /rust/kernel/alloc.rs
parent31d94d8f586df55e7dce47a67a8428f46d09f906 (diff)
rust: alloc: introduce the `VecExt` trait
Make `try_with_capacity`, `try_push`, and `try_extend_from_slice` methods available in `Vec` even though it doesn't implement them. It is implemented with `try_reserve` and `push_within_capacity`. This is in preparation for switching to the upstream `alloc` crate. Reviewed-by: Benno Lossin <benno.lossin@proton.me> Suggested-by: Gary Guo <gary@garyguo.net> Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Link: https://lore.kernel.org/r/20240328013603.206764-3-wedsonaf@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/alloc.rs')
-rw-r--r--rust/kernel/alloc.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/kernel/alloc.rs b/rust/kernel/alloc.rs
index 9aa5077d4a4c..2c99635f9fd3 100644
--- a/rust/kernel/alloc.rs
+++ b/rust/kernel/alloc.rs
@@ -5,3 +5,4 @@
#[cfg(not(test))]
#[cfg(not(testlib))]
mod allocator;
+pub mod vec_ext;