Skip to content

Commit b53aa8d

Browse files
committed
rust: samples: use try_format! in sample module
Signed-off-by: Mateusz Jabłoński <[email protected]>
1 parent 6cc6f2f commit b53aa8d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

samples/rust/rust_minimal.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#![no_std]
66
#![feature(allocator_api, global_asm)]
77

8+
use alloc::try_format;
89
use kernel::prelude::*;
910

1011
module! {
@@ -25,7 +26,7 @@ impl KernelModule for RustMinimal {
2526
pr_info!("Am I built-in? {}\n", !cfg!(MODULE));
2627

2728
Ok(RustMinimal {
28-
message: "on the heap!".try_to_owned()?,
29+
message: try_format!("on the {}!", "heap")?,
2930
})
3031
}
3132
}

0 commit comments

Comments
 (0)