From 4bab7f45c3a98103e21b610b3d0d73348d9545e5 Mon Sep 17 00:00:00 2001 From: Gerd Zellweger Date: Mon, 14 Jun 2021 09:44:05 -0700 Subject: [PATCH 1/3] Update loopback.rs --- src/phy/loopback.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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; From e36fabce2d19959eacf918fb6837ad114edf8552 Mon Sep 17 00:00:00 2001 From: Gerd Zellweger Date: Mon, 14 Jun 2021 13:39:33 -0700 Subject: [PATCH 2/3] Also import alloc crate for std. --- src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 9b83b4769..0c32c7f58 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -88,7 +88,6 @@ compile_error!("at least one socket needs to be enabled"); */ #![allow(clippy::option_map_unit_fn)] #![allow(clippy::unit_arg)] -#[cfg(feature = "alloc")] extern crate alloc; #[cfg(not(any(feature = "proto-ipv4", feature = "proto-ipv6")))] From 95f7abff90edc14c8c3835b66e00476ec1805944 Mon Sep 17 00:00:00 2001 From: Gerd Zellweger Date: Mon, 14 Jun 2021 15:16:15 -0700 Subject: [PATCH 3/3] Fix unused extern crate warning with certain build flags. --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 0c32c7f58..dac1a0675 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -88,6 +88,7 @@ compile_error!("at least one socket needs to be enabled"); */ #![allow(clippy::option_map_unit_fn)] #![allow(clippy::unit_arg)] +#[cfg(any(feature = "std", feature = "alloc"))] extern crate alloc; #[cfg(not(any(feature = "proto-ipv4", feature = "proto-ipv6")))]