From ea41e06a301f73ab60724a751f8ab3c354df98ee Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Fri, 6 Sep 2024 07:43:59 +0000 Subject: [PATCH] Apply lints from Clippy 1.81.0 --- io/zenoh-links/zenoh-link-tcp/src/unicast.rs | 2 +- io/zenoh-links/zenoh-link-vsock/src/unicast.rs | 2 +- io/zenoh-transport/src/unicast/establishment/accept.rs | 9 ++------- io/zenoh-transport/src/unicast/establishment/open.rs | 9 ++------- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/io/zenoh-links/zenoh-link-tcp/src/unicast.rs b/io/zenoh-links/zenoh-link-tcp/src/unicast.rs index 7532055f8e..ec2e6e06b7 100644 --- a/io/zenoh-links/zenoh-link-tcp/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-tcp/src/unicast.rs @@ -348,7 +348,7 @@ impl LinkManagerUnicastTrait for LinkManagerUnicastTcp { // Update the endpoint locator address endpoint = EndPoint::new( endpoint.protocol(), - &format!("{local_addr}"), + format!("{local_addr}"), endpoint.metadata(), endpoint.config(), )?; diff --git a/io/zenoh-links/zenoh-link-vsock/src/unicast.rs b/io/zenoh-links/zenoh-link-vsock/src/unicast.rs index e7b261f292..979048b585 100644 --- a/io/zenoh-links/zenoh-link-vsock/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-vsock/src/unicast.rs @@ -267,7 +267,7 @@ impl LinkManagerUnicastTrait for LinkManagerUnicastVsock { // Update the endpoint locator address endpoint = EndPoint::new( endpoint.protocol(), - &format!("{local_addr}"), + format!("{local_addr}"), endpoint.metadata(), endpoint.config(), )?; diff --git a/io/zenoh-transport/src/unicast/establishment/accept.rs b/io/zenoh-transport/src/unicast/establishment/accept.rs index 64949357c6..01d38a47b8 100644 --- a/io/zenoh-transport/src/unicast/establishment/accept.rs +++ b/io/zenoh-transport/src/unicast/establishment/accept.rs @@ -24,7 +24,6 @@ use zenoh_link::LinkUnicast; use zenoh_protocol::{ core::{Field, Resolution, WhatAmI, ZenohIdProto}, transport::{ - batch_size, close::{self, Close}, BatchSize, InitAck, OpenAck, TransportBody, TransportMessage, TransportSn, }, @@ -211,11 +210,7 @@ impl<'a, 'b: 'a> AcceptFsm for &'a mut AcceptLink<'b> { }; // Compute the minimum batch size - state.transport.batch_size = state - .transport - .batch_size - .min(init_syn.batch_size) - .min(batch_size::UNICAST); + state.transport.batch_size = state.transport.batch_size.min(init_syn.batch_size); // Extension QoS self.ext_qos @@ -687,7 +682,7 @@ pub(crate) async fn accept_link(link: LinkUnicast, manager: &TransportManager) - let iack_out = { let mut state = State { transport: StateTransport { - batch_size: manager.config.batch_size.min(batch_size::UNICAST).min(mtu), + batch_size: manager.config.batch_size.min(mtu), resolution: manager.config.resolution, ext_qos: ext::qos::StateAccept::new(manager.config.unicast.is_qos), #[cfg(feature = "transport_multilink")] diff --git a/io/zenoh-transport/src/unicast/establishment/open.rs b/io/zenoh-transport/src/unicast/establishment/open.rs index a9e797228e..468b2095d9 100644 --- a/io/zenoh-transport/src/unicast/establishment/open.rs +++ b/io/zenoh-transport/src/unicast/establishment/open.rs @@ -22,8 +22,7 @@ use zenoh_link::LinkUnicast; use zenoh_protocol::{ core::{Field, Resolution, WhatAmI, ZenohIdProto}, transport::{ - batch_size, close, BatchSize, Close, InitSyn, OpenSyn, TransportBody, TransportMessage, - TransportSn, + close, BatchSize, Close, InitSyn, OpenSyn, TransportBody, TransportMessage, TransportSn, }, }; use zenoh_result::ZResult; @@ -571,11 +570,7 @@ pub(crate) async fn open_link( let mut state = State { transport: StateTransport { - batch_size: manager - .config - .batch_size - .min(batch_size::UNICAST) - .min(link.config.batch.mtu), + batch_size: manager.config.batch_size.min(link.config.batch.mtu), resolution: manager.config.resolution, ext_qos: ext::qos::StateOpen::new(manager.config.unicast.is_qos), #[cfg(feature = "transport_multilink")]