Przeglądaj źródła

Merge pull request #858 from ssrlive/patch-1

Fix PacketMeta doc issues
Dario Nieuwenhuis 1 rok temu
rodzic
commit
a5da783153
1 zmienionych plików z 6 dodań i 3 usunięć
  1. 6 3
      src/phy/mod.rs

+ 6 - 3
src/phy/mod.rs

@@ -149,9 +149,12 @@ pub use self::tuntap_interface::TunTapInterface;
 /// default values and then set the fields you want. This makes adding metadata
 /// fields a non-breaking change.
 ///
-/// ```rust,ignore
-/// let mut meta = PacketMeta::new();
-/// meta.id = 15;
+/// ```rust
+/// let mut meta = smoltcp::phy::PacketMeta::default();
+/// #[cfg(feature = "packetmeta-id")]
+/// {
+///     meta.id = 15;
+/// }
 /// ```
 #[cfg_attr(feature = "defmt", derive(defmt::Format))]
 #[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Default)]