mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-20 18:23:41 +00:00
Apply remaining clippy suggestions from clippy 1.67
This commit is contained in:
@@ -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>(())
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user