summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorWedson Almeida Filho <walmeida@microsoft.com>2024-03-27 22:36:00 -0300
committerMiguel Ojeda <ojeda@kernel.org>2024-04-16 22:50:04 +0200
commit5ab560ce12ed0df3450968cfe4211e398ff2a8d7 (patch)
treebdfaadad4ebd10c15af61bfc175e97f677e89085 /samples
parent08d3f54928796557fc832467ad54f04908fc14e4 (diff)
rust: alloc: update `VecExt` to take allocation flags
We also rename the methods by removing the `try_` prefix since the names are available due to our usage of the `no_global_oom_handling` config when building the `alloc` crate. Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Link: https://lore.kernel.org/r/20240328013603.206764-8-wedsonaf@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/rust/rust_minimal.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/samples/rust/rust_minimal.rs b/samples/rust/rust_minimal.rs
index dc05f4bbe27e..2a9eaab62d1c 100644
--- a/samples/rust/rust_minimal.rs
+++ b/samples/rust/rust_minimal.rs
@@ -22,9 +22,9 @@ impl kernel::Module for RustMinimal {
pr_info!("Am I built-in? {}\n", !cfg!(MODULE));
let mut numbers = Vec::new();
- numbers.try_push(72)?;
- numbers.try_push(108)?;
- numbers.try_push(200)?;
+ numbers.push(72, GFP_KERNEL)?;
+ numbers.push(108, GFP_KERNEL)?;
+ numbers.push(200, GFP_KERNEL)?;
Ok(RustMinimal { numbers })
}