Skip to content

Commit

Permalink
use dervive Default as opposed to a const EMPTY_STATS
Browse files Browse the repository at this point in the history
  • Loading branch information
kornstar11 committed Dec 10, 2019
1 parent 8c488a1 commit 4bcd3fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mod stats;
mod stream;

pub use crate::{
config::Config, errors::Error, handle::Handle, info::Info, packet::Packet, stats::Stats, stats::EMPTY_STATS,
config::Config, errors::Error, handle::Handle, info::Info, packet::Packet, stats::Stats,
stream::PacketStream,
bridge_stream::BridgeStream
};
Expand Down
4 changes: 2 additions & 2 deletions src/stats.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#[derive(Clone, Debug)]
#[derive(Clone, Debug, Default)]
pub struct Stats {
pub received: u32,
pub dropped_by_kernel: u32,
pub dropped_by_interface: u32,
}

pub const EMPTY_STATS: Stats = Stats{ received: 0, dropped_by_kernel: 0, dropped_by_interface: 0 };
//pub const EMPTY_STATS: Stats = Stats{ received: 0, dropped_by_kernel: 0, dropped_by_interface: 0 };

impl Stats {
pub fn combine(&self, other: &Stats) -> Stats {
Expand Down

0 comments on commit 4bcd3fe

Please sign in to comment.