diff --git a/.travis.yml b/.travis.yml index edbf98a..36d2c79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,11 +18,12 @@ matrix: env: TARGET=i686-unknown-linux-gnu before_script: - - cargo +nightly install --force rustfmt-nightly + - cargo +nightly install + #- cargo +nightly install --force rustfmt-nightly script: - export PATH="/usr/include:$PATH" - - cargo +nightly fmt --all -- --check + #- cargo +nightly fmt --all -- --check - cargo test - cargo doc --no-deps diff --git a/src/lib.rs b/src/lib.rs index ed6bd31..68a2c35 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,7 +33,7 @@ mod stats; mod stream; pub use crate::{ - config::Config, errors::Error, handle::Handle, info::Info, packet::Packet, stats::Stats, + config::Config, errors::Error, handle::Handle, info::Info, packet::Packet, stats::Stats, stats::EMPTY_STATS, stream::PacketStream, bridge_stream::BridgeStream }; diff --git a/src/stats.rs b/src/stats.rs index 1886810..05dd135 100644 --- a/src/stats.rs +++ b/src/stats.rs @@ -5,7 +5,7 @@ pub struct Stats { 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 = Default::default(); impl Stats { pub fn combine(&self, other: &Stats) -> Stats {