Fix clippy suggestions from 1.57

This commit is contained in:
Dirkjan Ochtman
2021-12-10 10:19:20 +01:00
parent b7c670f15f
commit 04076f7597
4 changed files with 3 additions and 32 deletions
+1 -11
View File
@@ -2,6 +2,7 @@ use std::time::Duration;
use hdrhistogram::Histogram;
#[derive(Default)]
pub struct Stats {
pub total_size: usize,
pub total_duration: Duration,
@@ -9,17 +10,6 @@ pub struct Stats {
pub stream_stats: StreamStats,
}
impl Default for Stats {
fn default() -> Self {
Self {
total_size: Default::default(),
total_duration: Default::default(),
streams: Default::default(),
stream_stats: StreamStats::default(),
}
}
}
impl Stats {
pub fn stream_finished(&mut self, stream_result: TransferResult) {
self.total_size += stream_result.size;
-2
View File
@@ -6,7 +6,6 @@ use libfuzzer_sys::fuzz_target;
extern crate proto;
use proto::fuzzing::{
ConnectionState, ResetStream, Retransmits, SendStream, Streams, StreamsState,
TransportParameters,
};
use proto::{Dir, Side, StreamId, VarInt};
@@ -19,7 +18,6 @@ struct StreamParams {
receive_window: u16,
stream_receive_window: u16,
dir: Dir,
transport_params: TransportParameters,
}
#[derive(Arbitrary, Debug)]
+1 -1
View File
@@ -261,7 +261,7 @@ mod json {
intervals: &stats
.intervals
.iter()
.map(|interval| Interval::from_stats_interval(interval))
.map(Interval::from_stats_interval)
.collect(),
};
+1 -18
View File
@@ -221,7 +221,7 @@ pub(crate) struct SentPacket {
}
/// Retransmittable data queue
#[derive(Debug, Clone)]
#[derive(Debug, Default, Clone)]
pub struct Retransmits {
pub(crate) max_data: bool,
pub(crate) max_uni_stream_id: bool,
@@ -253,23 +253,6 @@ impl Retransmits {
}
}
impl Default for Retransmits {
fn default() -> Self {
Self {
max_data: false,
max_uni_stream_id: false,
max_bi_stream_id: false,
reset_stream: Vec::new(),
stop_sending: Vec::new(),
max_stream_data: FxHashSet::default(),
crypto: VecDeque::new(),
new_cids: Vec::new(),
retire_cids: Vec::new(),
handshake_done: false,
}
}
}
impl ::std::ops::BitOrAssign for Retransmits {
fn bitor_assign(&mut self, rhs: Self) {
// We reduce in-stream head-of-line blocking by queueing retransmits before other data for