Skip to content

Commit 0913544

Browse files
committed
use dervive Default as opposed to a const EMPTY_STATS
1 parent 10c181f commit 0913544

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mod stats;
3333
mod stream;
3434

3535
pub use crate::{
36-
config::Config, errors::Error, handle::Handle, info::Info, packet::Packet, stats::Stats, stats::EMPTY_STATS,
36+
config::Config, errors::Error, handle::Handle, info::Info, packet::Packet, stats::Stats,
3737
stream::PacketStream,
3838
bridge_stream::BridgeStream
3939
};

src/stats.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#[derive(Clone, Debug)]
1+
#[derive(Clone, Debug, Default)]
22
pub struct Stats {
33
pub received: u32,
44
pub dropped_by_kernel: u32,
55
pub dropped_by_interface: u32,
66
}
77

8-
pub const EMPTY_STATS: Stats = Stats{ received: 0, dropped_by_kernel: 0, dropped_by_interface: 0 };
8+
//pub const EMPTY_STATS: Stats = Stats{ received: 0, dropped_by_kernel: 0, dropped_by_interface: 0 };
99

1010
impl Stats {
1111
pub fn combine(&self, other: &Stats) -> Stats {

0 commit comments

Comments
 (0)