Skip to content

Commit

Permalink
rust: prelude: split re-exports into groups
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Wei Liu <[email protected]>
Signed-off-by: Miguel Ojeda <[email protected]>
  • Loading branch information
ojeda committed Dec 1, 2022
1 parent f0c4d9f commit 474be44
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions rust/kernel/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
//! 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;

0 comments on commit 474be44

Please sign in to comment.