From 9b25d4111e913b74a1756601449484c44fc58842 Mon Sep 17 00:00:00 2001 From: Danilo Krummrich Date: Wed, 13 May 2026 21:09:15 +0200 Subject: rust: alloc: cleanup imports and use "kernel vertical" style Change all imports in the alloc module to use the "kernel vertical" import style [1]. While at it, drop unnecessary imports covered by prelude::*. Link: https://docs.kernel.org/rust/coding-guidelines.html#imports [1] Reviewed-by: Eliot Courtney Link: https://patch.msgid.link/20260513190946.619810-1-dakr@kernel.org Signed-off-by: Danilo Krummrich --- rust/kernel/alloc/layout.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rust/kernel/alloc/layout.rs') diff --git a/rust/kernel/alloc/layout.rs b/rust/kernel/alloc/layout.rs index 9f8be72feb7a..b629da4aed07 100644 --- a/rust/kernel/alloc/layout.rs +++ b/rust/kernel/alloc/layout.rs @@ -4,7 +4,10 @@ //! //! Custom layout types extending or improving [`Layout`]. -use core::{alloc::Layout, marker::PhantomData}; +use core::{ + alloc::Layout, + marker::PhantomData, // +}; /// Error when constructing an [`ArrayLayout`]. pub struct LayoutError; -- cgit v1.2.3 From ec51531fb8efda9b75316111c040dd756f815b0c Mon Sep 17 00:00:00 2001 From: Danilo Krummrich Date: Wed, 13 May 2026 21:09:16 +0200 Subject: rust: alloc: cleanup doctest imports to "kernel vertical" style Change all imports in the alloc module's doctests to use the "kernel vertical" import style [1]. While at it, drop imports that are automatically included in doctests. Link: https://docs.kernel.org/rust/coding-guidelines.html#imports [1] Reviewed-by: Eliot Courtney Link: https://patch.msgid.link/20260513190946.619810-2-dakr@kernel.org Signed-off-by: Danilo Krummrich --- rust/kernel/alloc/layout.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rust/kernel/alloc/layout.rs') diff --git a/rust/kernel/alloc/layout.rs b/rust/kernel/alloc/layout.rs index b629da4aed07..62a459c66baf 100644 --- a/rust/kernel/alloc/layout.rs +++ b/rust/kernel/alloc/layout.rs @@ -50,7 +50,10 @@ impl ArrayLayout { /// # Examples /// /// ``` - /// # use kernel::alloc::layout::{ArrayLayout, LayoutError}; + /// # use kernel::alloc::layout::{ + /// # ArrayLayout, + /// # LayoutError, // + /// # }; /// let layout = ArrayLayout::::new(15)?; /// assert_eq!(layout.len(), 15); /// -- cgit v1.2.3