From 64f7bacccc7b31c85cf54dfd532cf15ff8dcef26 Mon Sep 17 00:00:00 2001 From: Ray Walker Date: Fri, 27 Nov 2026 11:07:41 +1100 Subject: [PATCH] test(reliability): pin the queue-full probe on the stack Beta clippy's unnecessary_box_pin rejects Box::pin on a future that is polled once and dropped in the same statement. pin! does the same job without the allocation. --- crates/cachekit/src/reliability.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cachekit/src/reliability.rs b/crates/cachekit/src/reliability.rs index 0364fab..ef28db4 100644 --- a/crates/cachekit/src/reliability.rs +++ b/crates/cachekit/src/reliability.rs @@ -987,7 +987,7 @@ pub(crate) fn wrap_reliable( #[cfg(test)] #[allow(clippy::expect_used)] // test-only: failed acquire/probe should panic loudly mod tests { - use std::pin::Pin; + use std::pin::{pin, Pin}; use std::task::{Context, Poll, Waker}; use super::*; @@ -1250,7 +1250,7 @@ mod tests { ); // Ready on the first poll is the queue-full shed: every other shed // path is only reachable after parking. - let third = poll_once(Box::pin(limiter.acquire()).as_mut()); + let third = poll_once(pin!(limiter.acquire())); assert!( matches!(&third, Poll::Ready(Err(err)) if err.kind == BackendErrorKind::Backpressure), "queue of 1 is full, so the third caller sheds on its first poll: {third:?}"