From 1ba2468a055ce2544641779d545d398fbc7e941f Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Thu, 5 Dec 2024 13:42:30 +0100 Subject: [PATCH] quinn: fix clippy warnings Part-of: --- net/quinn/src/quinnwtclientsrc/imp.rs | 5 +---- net/quinn/src/quinnwtserversink/imp.rs | 12 +++++++----- net/quinn/src/utils.rs | 10 +++------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/net/quinn/src/quinnwtclientsrc/imp.rs b/net/quinn/src/quinnwtclientsrc/imp.rs index 2a41d30d..f6a66596 100644 --- a/net/quinn/src/quinnwtclientsrc/imp.rs +++ b/net/quinn/src/quinnwtclientsrc/imp.rs @@ -319,10 +319,7 @@ impl BaseSrcImpl for QuinnWebTransportClientSrc { if let State::Started(ref mut state) = *state { let session = &state.session; - session.close( - CONNECTION_CLOSE_CODE.into(), - CONNECTION_CLOSE_MSG.as_bytes(), - ); + session.close(CONNECTION_CLOSE_CODE, CONNECTION_CLOSE_MSG.as_bytes()); } *state = State::Stopped; diff --git a/net/quinn/src/quinnwtserversink/imp.rs b/net/quinn/src/quinnwtserversink/imp.rs index 1ad54539..89c9be0c 100644 --- a/net/quinn/src/quinnwtserversink/imp.rs +++ b/net/quinn/src/quinnwtserversink/imp.rs @@ -61,10 +61,12 @@ struct Settings { impl Default for Settings { fn default() -> Self { - let mut transport_config = QuinnQuicTransportConfig::default(); - // Required for the WebTransport handshake - transport_config.max_concurrent_bidi_streams = 2u32.into(); - transport_config.max_concurrent_uni_streams = 1u32.into(); + let transport_config = QuinnQuicTransportConfig { + // Required for the WebTransport handshake + max_concurrent_bidi_streams: 2u32.into(), + max_concurrent_uni_streams: 1u32.into(), + ..Default::default() + }; Settings { address: DEFAULT_ADDR.to_string(), @@ -447,7 +449,7 @@ impl BaseSinkImpl for QuinnWebTransportServerSink { }; } - session.close(CONNECTION_CLOSE_CODE.into(), close_msg.as_bytes()); + session.close(CONNECTION_CLOSE_CODE, close_msg.as_bytes()); } *state = State::Stopped; diff --git a/net/quinn/src/utils.rs b/net/quinn/src/utils.rs index 8a20c34d..8e7ef288 100644 --- a/net/quinn/src/utils.rs +++ b/net/quinn/src/utils.rs @@ -230,14 +230,10 @@ fn create_transport_config( )); transport_config .datagram_send_buffer_size(ep_config.transport_config.datagram_send_buffer_size); - transport_config.max_concurrent_bidi_streams( - ep_config - .transport_config - .max_concurrent_bidi_streams - .into(), - ); transport_config - .max_concurrent_uni_streams(ep_config.transport_config.max_concurrent_uni_streams.into()); + .max_concurrent_bidi_streams(ep_config.transport_config.max_concurrent_bidi_streams); + transport_config + .max_concurrent_uni_streams(ep_config.transport_config.max_concurrent_uni_streams); transport_config.mtu_discovery_config(Some(mtu_config)); transport_config