From a54bea810acc60b999ea34f4e676ea2b6f277624 Mon Sep 17 00:00:00 2001 From: mmynk Date: Mon, 29 Jan 2024 21:59:19 +0000 Subject: [PATCH] Add `Default` macro for non-exhaustive types --- src/tc/qdiscs/fq_codel.rs | 4 ++-- src/tc/stats/basic.rs | 2 +- src/tc/stats/compat.rs | 2 +- src/tc/stats/queue.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tc/qdiscs/fq_codel.rs b/src/tc/qdiscs/fq_codel.rs index 40ee25b9..a19484b4 100644 --- a/src/tc/qdiscs/fq_codel.rs +++ b/src/tc/qdiscs/fq_codel.rs @@ -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, @@ -151,7 +151,7 @@ impl Emitable for TcFqCodelQdStats { } } -#[derive(Debug, PartialEq, Eq, Clone, Copy)] +#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] #[non_exhaustive] pub struct TcFqCodelClStats { deficit: i32, diff --git a/src/tc/stats/basic.rs b/src/tc/stats/basic.rs index b0a8989c..786fee9c 100644 --- a/src/tc/stats/basic.rs +++ b/src/tc/stats/basic.rs @@ -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 diff --git a/src/tc/stats/compat.rs b/src/tc/stats/compat.rs index 53648f2d..5d8cd397 100644 --- a/src/tc/stats/compat.rs +++ b/src/tc/stats/compat.rs @@ -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 diff --git a/src/tc/stats/queue.rs b/src/tc/stats/queue.rs index cfcf6ad5..9909e819 100644 --- a/src/tc/stats/queue.rs +++ b/src/tc/stats/queue.rs @@ -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