aboutsummaryrefslogtreecommitdiffstats
path: root/samples/rust/rust_print_main.rs
diff options
context:
space:
mode:
authorTamir Duberstein <[email protected]>2025-07-04 20:14:54 +0000
committerMiguel Ojeda <[email protected]>2025-07-20 23:16:35 +0000
commit386f285d885ae40b64ccf8328d59694055af3187 (patch)
tree2fea8e1dbe2a3c23e7db38c67d61d98c4d2f952b /samples/rust/rust_print_main.rs
parentrust: kernel: add `fmt` module (diff)
downloadkernel-386f285d885ae40b64ccf8328d59694055af3187.tar.gz
kernel-386f285d885ae40b64ccf8328d59694055af3187.zip
rust: use `kernel::{fmt,prelude::fmt!}`
Reduce coupling to implementation details of the formatting machinery by avoiding direct use for `core`'s formatting traits and macros. Signed-off-by: Tamir Duberstein <[email protected]> Reviewed-by: Benno Lossin <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'samples/rust/rust_print_main.rs')
-rw-r--r--samples/rust/rust_print_main.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/rust/rust_print_main.rs b/samples/rust/rust_print_main.rs
index 8ea95e8c2f36..4095c72afeab 100644
--- a/samples/rust/rust_print_main.rs
+++ b/samples/rust/rust_print_main.rs
@@ -40,7 +40,7 @@ fn arc_print() -> Result {
// behaviour, contract or protocol on both `i32` and `&str` into a single `Arc` of
// type `Arc<dyn Display>`.
- use core::fmt::Display;
+ use kernel::fmt::Display;
fn arc_dyn_print(arc: &Arc<dyn Display>) {
pr_info!("Arc<dyn Display> says {arc}");
}