diff --git a/src/lib.rs b/src/lib.rs index 9b83b4769..dac1a0675 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -88,7 +88,7 @@ compile_error!("at least one socket needs to be enabled"); */ #![allow(clippy::option_map_unit_fn)] #![allow(clippy::unit_arg)] -#[cfg(feature = "alloc")] +#[cfg(any(feature = "std", feature = "alloc"))] extern crate alloc; #[cfg(not(any(feature = "proto-ipv4", feature = "proto-ipv6")))] diff --git a/src/phy/loopback.rs b/src/phy/loopback.rs index beeba9f6b..c44c97ce7 100644 --- a/src/phy/loopback.rs +++ b/src/phy/loopback.rs @@ -1,12 +1,7 @@ -#[cfg(feature = "std")] -use std::vec::Vec; -#[cfg(feature = "std")] -use std::collections::VecDeque; -#[cfg(feature = "alloc")] use alloc::vec::Vec; -#[cfg(all(feature = "alloc", not(feature = "rust-1_28")))] +#[cfg(not(feature = "rust-1_28"))] use alloc::collections::VecDeque; -#[cfg(all(feature = "alloc", feature = "rust-1_28"))] +#[cfg(feature = "rust-1_28")] use alloc::VecDeque; use crate::Result;