Skip to content

Commit

Permalink
Add missing mtu field in Debug implementations and serde
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 29, 2024
1 parent c1e5efa commit e7a9fec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ impl std::fmt::Debug for crate::NetworkData {
.field("total errors income", &self.total_errors_on_received())
.field("errors outcome", &self.errors_on_transmitted())
.field("total errors outcome", &self.total_errors_on_transmitted())
.field("maximum transfer unit", &self.mtu())
.finish()
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ impl Serialize for crate::NetworkData {
where
S: Serializer,
{
// `13` corresponds to the number of fields.
let mut state = serializer.serialize_struct("NetworkData", 13)?;
// `14` corresponds to the number of fields.
let mut state = serializer.serialize_struct("NetworkData", 14)?;

state.serialize_field("received", &self.received())?;
state.serialize_field("total_received", &self.total_received())?;
Expand All @@ -366,6 +366,7 @@ impl Serialize for crate::NetworkData {
)?;
state.serialize_field("mac_address", &self.mac_address())?;
state.serialize_field("ip_networks", &self.ip_networks())?;
state.serialize_field("mtu", &self.mtu())?;

state.end()
}
Expand Down

0 comments on commit e7a9fec

Please sign in to comment.