diff --git a/crates/ironrdp-error/src/lib.rs b/crates/ironrdp-error/src/lib.rs index 5d05b422..5548b3ed 100644 --- a/crates/ironrdp-error/src/lib.rs +++ b/crates/ironrdp-error/src/lib.rs @@ -2,6 +2,8 @@ #[cfg(feature = "alloc")] extern crate alloc; +#[cfg(feature = "alloc")] +use alloc::boxed::Box; use core::fmt; @@ -24,7 +26,7 @@ pub struct Error { #[cfg(feature = "std")] source: Option>, #[cfg(all(not(feature = "std"), feature = "alloc"))] - source: Option>, + source: Option>, } impl Error { @@ -48,7 +50,7 @@ impl Error { #[cfg(feature = "alloc")] { let mut this = self; - this.source = Some(alloc::boxed::Box::new(source)); + this.source = Some(Box::new(source)); this }