Skip to content

Commit

Permalink
clippy: add boxed module
Browse files Browse the repository at this point in the history
This allows downstream packages to write `use boxed::*`, and circumvent
the issue with redundant imports.
  • Loading branch information
hackaugusto committed Feb 21, 2024
1 parent 905e579 commit ddb7f0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 6 additions & 0 deletions utils/core/src/boxed.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#[cfg(not(feature = "std"))]
pub use alloc::boxed::Box;

#[cfg(feature = "std")]
pub use std::boxed::Box;
8 changes: 2 additions & 6 deletions utils/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
#[macro_use]
extern crate alloc;

pub mod boxed;
pub mod collections;
pub mod iterators;
pub mod string;

pub use boxed::*;
use collections::*;
use core::{mem, slice};

Expand All @@ -37,12 +39,6 @@ use iterators::*;
#[cfg(feature = "concurrent")]
pub use rayon;

#[cfg(not(feature = "std"))]
pub use alloc::boxed::Box;

#[cfg(feature = "std")]
pub use std::boxed::Box;

// AS BYTES
// ================================================================================================

Expand Down

0 comments on commit ddb7f0d

Please sign in to comment.