rust: prelude: split re-exports into groups
authorMiguel Ojeda <ojeda@kernel.org>
Thu, 10 Nov 2022 16:41:13 +0000 (17:41 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Thu, 1 Dec 2022 19:12:02 +0000 (20:12 +0100)
Split the prelude re-exports into groups: first the ones coming
from the `core` crate, then `alloc`, then our own crates and
finally the ones from modules from `kernel` itself (i.e. `super`).

We are doing this manually for the moment, but ideally, long-term,
this could be automated via `rustfmt` with options such as
`group_imports` and `imports_granularity` (both currently unstable).

Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/prelude.rs

index 495e2225072685fac6476bcbf2723962a88cc87f..f8219285d8c00823665e81fcbe7ce18bfec7c6e9 100644 (file)
 //! use kernel::prelude::*;
 //! ```
 
-pub use super::{
-    error::{Error, Result},
-    pr_emerg, pr_info, ThisModule,
-};
-pub use alloc::{boxed::Box, vec::Vec};
 pub use core::pin::Pin;
+
+pub use alloc::{boxed::Box, vec::Vec};
+
 pub use macros::module;
+
+pub use super::{pr_emerg, pr_info};
+
+pub use super::error::{Error, Result};
+
+pub use super::ThisModule;