Skip to content

Commit b3b53ea

Browse files
committed
fix: clippy tokio-rich feature set (used_underscore_binding, ignored_unit_patterns)
The 'clippy (tokio-rich)' job exercises the non-compio feature combination and tripped over two lints not caught by the previous batch: - `tako-core/src/client.rs`: the `_conn_handle` field on TakoClient/TakoTlsClient was originally underscore-prefixed to signal 'unused' to the compiler, but CB21 added a Drop impl that calls `self._conn_handle.abort()` — the binding IS used now, so clippy correctly complains. Rename to `conn_handle` (no underscore) and switch the two struct-literal sites to shorthand. - `tako-core/src/signals.rs`: the `#[cfg(not(feature = "compio"))]` branch of subscribe_filtered also had `Ok(_) => {}` — the previous fix only caught the compio branch. Both branches now use `Ok(()) => {}` for symmetry.
1 parent aaeffb5 commit b3b53ea

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

tako-core/src/client.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ where
341341
/// HTTP/1.1 request sender for the established TLS connection.
342342
sender: SendRequest<B>,
343343
/// Background task handle managing the connection lifecycle.
344-
_conn_handle: JoinHandle<Result<(), hyper::Error>>,
344+
conn_handle: JoinHandle<Result<(), hyper::Error>>,
345345
}
346346

347347
impl<B> TakoTlsClient<B>
@@ -384,7 +384,7 @@ where
384384

385385
Ok(Self {
386386
sender,
387-
_conn_handle: conn_handle,
387+
conn_handle,
388388
})
389389
}
390390

@@ -446,12 +446,12 @@ where
446446
B::Error: Into<Box<dyn Error + Send + Sync>>,
447447
{
448448
fn drop(&mut self) {
449-
// Without this, dropping `_conn_handle` simply detaches the task and
449+
// Without this, dropping `conn_handle` simply detaches the task and
450450
// the background connection driver keeps running until the remote
451451
// closes (or forever for long-lived idle connections). Abort it so
452452
// the underlying TLS stream is dropped and any pending Tokio task
453453
// is cleared from the runtime.
454-
self._conn_handle.abort();
454+
self.conn_handle.abort();
455455
}
456456
}
457457

@@ -498,7 +498,7 @@ where
498498
/// HTTP/1.1 request sender for the established TCP connection.
499499
sender: SendRequest<B>,
500500
/// Background task handle managing the connection lifecycle.
501-
_conn_handle: JoinHandle<Result<(), hyper::Error>>,
501+
conn_handle: JoinHandle<Result<(), hyper::Error>>,
502502
}
503503

504504
impl<B> TakoClient<B>
@@ -529,7 +529,7 @@ where
529529

530530
Ok(Self {
531531
sender,
532-
_conn_handle: conn_handle,
532+
conn_handle,
533533
})
534534
}
535535

@@ -594,6 +594,6 @@ where
594594
// See `TakoTlsClient::drop` — abort the background connection driver
595595
// instead of detaching it so dropping the client deterministically
596596
// closes the underlying TCP stream and frees the Tokio task slot.
597-
self._conn_handle.abort();
597+
self.conn_handle.abort();
598598
}
599599
}

tako-core/src/signals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ impl SignalArbiter {
452452
while let Ok(signal) = rx.recv().await {
453453
if filter(&signal) {
454454
match tx.try_send(signal) {
455-
Ok(_) => {}
455+
Ok(()) => {}
456456
Err(mpsc::error::TrySendError::Full(_)) => {
457457
// Slow consumer: drop the signal silently to preserve back-pressure.
458458
}

0 commit comments

Comments
 (0)