Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply lints from Clippy 1.81.0 #1365

Merged
merged 6 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion io/zenoh-links/zenoh-link-tcp/src/unicast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)?;
Expand Down
2 changes: 1 addition & 1 deletion io/zenoh-links/zenoh-link-vsock/src/unicast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)?;
Expand Down
18 changes: 12 additions & 6 deletions io/zenoh-transport/src/unicast/establishment/accept.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,14 @@ 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);
#[allow(clippy::unnecessary_min_or_max)]
fuzzypixelz marked this conversation as resolved.
Show resolved Hide resolved
{
state.transport.batch_size = state
.transport
.batch_size
.min(init_syn.batch_size)
.min(batch_size::UNICAST);
}

// Extension QoS
self.ext_qos
Expand Down Expand Up @@ -684,10 +687,13 @@ pub(crate) async fn accept_link(link: LinkUnicast, manager: &TransportManager) -
};
}

#[allow(clippy::unnecessary_min_or_max)]
fuzzypixelz marked this conversation as resolved.
Show resolved Hide resolved
let batch_size = manager.config.batch_size.min(batch_size::UNICAST).min(mtu);

let iack_out = {
let mut state = State {
transport: StateTransport {
batch_size: manager.config.batch_size.min(batch_size::UNICAST).min(mtu),
Mallets marked this conversation as resolved.
Show resolved Hide resolved
batch_size,
resolution: manager.config.resolution,
ext_qos: ext::qos::StateAccept::new(manager.config.unicast.is_qos),
#[cfg(feature = "transport_multilink")]
Expand Down
13 changes: 8 additions & 5 deletions io/zenoh-transport/src/unicast/establishment/open.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,16 @@ pub(crate) async fn open_link(
ext_compression: ext::compression::CompressionFsm::new(),
};

#[allow(clippy::unnecessary_min_or_max)]
fuzzypixelz marked this conversation as resolved.
Show resolved Hide resolved
let batch_size = manager
.config
.batch_size
.min(link.config.batch.mtu)
.min(batch_size::UNICAST);

let mut state = State {
transport: StateTransport {
batch_size: manager
.config
.batch_size
.min(batch_size::UNICAST)
.min(link.config.batch.mtu),
batch_size,
resolution: manager.config.resolution,
ext_qos: ext::qos::StateOpen::new(manager.config.unicast.is_qos),
#[cfg(feature = "transport_multilink")]
Expand Down
Loading