Skip to content

Commit

Permalink
Add Default macro for non-exhaustive types
Browse files Browse the repository at this point in the history
  • Loading branch information
mmynk committed Jan 29, 2024
1 parent fb497b3 commit a54bea8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/tc/qdiscs/fq_codel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Emitable for TcFqCodelXstats {
}
}

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)]
#[non_exhaustive]
pub struct TcFqCodelQdStats {
pub maxpacket: u32,
Expand Down Expand Up @@ -151,7 +151,7 @@ impl Emitable for TcFqCodelQdStats {
}
}

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)]

Check warning on line 154 in src/tc/qdiscs/fq_codel.rs

View check run for this annotation

Codecov / codecov/patch

src/tc/qdiscs/fq_codel.rs#L154

Added line #L154 was not covered by tests
#[non_exhaustive]
pub struct TcFqCodelClStats {
deficit: i32,
Expand Down
2 changes: 1 addition & 1 deletion src/tc/stats/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use netlink_packet_utils::{
};

/// Byte/Packet throughput statistics
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)]
#[non_exhaustive]
pub struct TcStatsBasic {
/// number of seen bytes
Expand Down
2 changes: 1 addition & 1 deletion src/tc/stats/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use netlink_packet_utils::{
};

/// Generic queue statistics
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)]
#[non_exhaustive]
pub struct TcStats {
/// Number of enqueued bytes
Expand Down
2 changes: 1 addition & 1 deletion src/tc/stats/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use netlink_packet_utils::{
};

/// Queuing statistics
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)]
#[non_exhaustive]
pub struct TcStatsQueue {
/// queue length
Expand Down

0 comments on commit a54bea8

Please sign in to comment.