Apply remaining clippy suggestions from clippy 1.67

This commit is contained in:
Dirkjan Ochtman
2023-02-26 22:25:54 +01:00
parent f7354ef6ac
commit 3cc7efbe55
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -79,10 +79,10 @@ async fn server(endpoint: quinn::Endpoint, opt: Opt) -> Result<()> {
};
trace!("stream established");
let _: tokio::task::JoinHandle<Result<()>> = tokio::spawn(async move {
tokio::spawn(async move {
drain_stream(&mut recv_stream, opt.read_unordered).await?;
send_data_on_stream(&mut send_stream, opt.download_size).await?;
Ok(())
Ok::<_, anyhow::Error>(())
});
}
+1 -1
View File
@@ -53,7 +53,7 @@ async fn main() {
async fn run(opt: Opt) -> Result<()> {
let (key, cert) = match (&opt.key, &opt.cert) {
(&Some(ref key), &Some(ref cert)) => {
(Some(key), Some(cert)) => {
let key = fs::read(key).context("reading key")?;
let cert = fs::read(cert).expect("reading cert");
+1 -1
View File
@@ -1337,7 +1337,7 @@ impl Connection {
let loss_delay = cmp::max(rtt.mul_f32(self.config.time_threshold), TIMER_GRANULARITY);
// Packets sent before this time are deemed lost.
let lost_send_time = now - loss_delay;
let lost_send_time = now.checked_sub(loss_delay).unwrap();
let largest_acked_packet = self.spaces[pn_space].largest_acked_packet.unwrap();
let packet_threshold = self.config.packet_threshold as u64;
let mut size_of_lost_packets = 0u64;