From 1cce1b5aa6848d84af7394457ad43b7176d36227 Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Tue, 9 Jul 2024 10:43:25 +0100 Subject: [PATCH] Remove private prelude module from units crate The private prelude module has been removed from the units crate and instead imports are stated in full when needed. --- units/src/lib.rs | 10 ---------- units/src/locktime/absolute.rs | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/units/src/lib.rs b/units/src/lib.rs index e3fbdf581..3a4b73fa8 100644 --- a/units/src/lib.rs +++ b/units/src/lib.rs @@ -59,13 +59,3 @@ pub use self::{ parse::ParseIntError, weight::Weight }; - -#[rustfmt::skip] -#[allow(unused_imports)] -mod prelude { - #[cfg(all(feature = "alloc", not(feature = "std")))] - pub use alloc::{string::{String, ToString}, vec::Vec, boxed::Box, borrow::{Borrow, BorrowMut, Cow, ToOwned}, slice, rc}; - - #[cfg(feature = "std")] - pub use std::{string::{String, ToString}, vec::Vec, boxed::Box, borrow::{Borrow, BorrowMut, Cow, ToOwned}, rc}; -} diff --git a/units/src/locktime/absolute.rs b/units/src/locktime/absolute.rs index 64a5094ce..fe0bb203e 100644 --- a/units/src/locktime/absolute.rs +++ b/units/src/locktime/absolute.rs @@ -2,6 +2,8 @@ //! Provides type `Height` and `Time` types used by the `rust-bitcoin` `absolute::LockTime` type. +#[cfg(feature = "alloc")] +use alloc::{string::String, boxed::Box}; use core::fmt; use internals::write_err; @@ -9,8 +11,6 @@ use internals::write_err; #[cfg(feature = "alloc")] use crate::parse; use crate::parse::ParseIntError; -#[cfg(feature = "alloc")] -use crate::prelude::{Box, String}; /// The Threshold for deciding whether a lock time value is a height or a time (see [Bitcoin Core]). ///