Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Default macro for non-exhaustive types #92

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
}
}

#[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 @@
}
}

#[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
Loading