浏览代码

iface: do not compile at all if no medium is enabled.

Dario Nieuwenhuis 3 年之前
父节点
当前提交
9372561ea1
共有 2 个文件被更改,包括 6 次插入10 次删除
  1. 0 10
      src/iface/mod.rs
  2. 6 0
      src/lib.rs

+ 0 - 10
src/iface/mod.rs

@@ -4,11 +4,6 @@ The `iface` module deals with the *network interfaces*. It filters incoming fram
 provides lookup and caching of hardware addresses, and handles management packets.
 */
 
-#[cfg(any(
-    feature = "medium-ethernet",
-    feature = "medium-ip",
-    feature = "medium-ieee802154"
-))]
 mod interface;
 #[cfg(any(feature = "medium-ethernet", feature = "medium-ieee802154"))]
 mod neighbor;
@@ -22,9 +17,4 @@ pub use self::neighbor::Cache as NeighborCache;
 pub use self::neighbor::Neighbor;
 pub use self::route::{Route, Routes};
 
-#[cfg(any(
-    feature = "medium-ethernet",
-    feature = "medium-ip",
-    feature = "medium-ieee802154"
-))]
 pub use self::interface::{Interface, InterfaceBuilder};

+ 6 - 0
src/lib.rs

@@ -139,7 +139,13 @@ mod rand;
 #[cfg(feature = "rand-custom-impl")]
 pub use crate::rand::Rand;
 
+#[cfg(any(
+    feature = "medium-ethernet",
+    feature = "medium-ip",
+    feature = "medium-ieee802154"
+))]
 pub mod iface;
+
 pub mod phy;
 #[cfg(feature = "socket")]
 pub mod socket;