Skip to content

Commit 4920659

Browse files
nipunn1313Convex, Inc.
authored and
Convex, Inc.
committed
Fix a lint caused by how async_lru doesn't have feature(testing) (#29000)
Could have either added feature=testing or removed the cfg. Decided to remove the cfg. GitOrigin-RevId: 00d23b21a6926d9340b5bcd399cf597bef00044a
1 parent 00ff716 commit 4920659

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

crates/async_lru/src/async_lru.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::{
1010

1111
use ::metrics::StatusTimer;
1212
use async_broadcast::Receiver as BroadcastReceiver;
13-
#[cfg(any(test, feature = "testing"))]
13+
#[cfg(test)]
1414
use common::pause::PauseClient;
1515
use common::{
1616
codel_queue::{
@@ -52,7 +52,7 @@ use crate::metrics::{
5252
log_async_lru_size,
5353
};
5454

55-
#[cfg(any(test, feature = "testing"))]
55+
#[cfg(test)]
5656
const PAUSE_DURING_GENERATE_VALUE_LABEL: &str = "generate_value";
5757

5858
/// A write through cache with support for cancelation.
@@ -79,7 +79,7 @@ pub struct AsyncLru<RT: Runtime, Key, Value> {
7979
// builds. We shouldn't use tokio locks for prod code (see
8080
// https://github.com/rust-lang/rust/issues/104883 for background and
8181
// https://github.com/get-convex/convex/pull/19307 for an alternative).
82-
#[cfg(any(test, feature = "testing"))]
82+
#[cfg(test)]
8383
pause_client: Option<Arc<tokio::sync::Mutex<PauseClient>>>,
8484
}
8585

@@ -91,7 +91,7 @@ impl<RT: Runtime, Key, Value> Clone for AsyncLru<RT, Key, Value> {
9191
Self {
9292
inner: self.inner.clone(),
9393
label: self.label,
94-
#[cfg(any(test, feature = "testing"))]
94+
#[cfg(test)]
9595
pause_client: self.pause_client.clone(),
9696
handle: self.handle.clone(),
9797
}
@@ -219,12 +219,12 @@ impl<
219219
max_size,
220220
concurrency,
221221
label,
222-
#[cfg(any(test, feature = "testing"))]
222+
#[cfg(test)]
223223
None,
224224
)
225225
}
226226

227-
#[cfg(any(test, feature = "testing"))]
227+
#[cfg(test)]
228228
#[allow(unused)]
229229
fn new_for_tests(
230230
rt: RT,
@@ -242,7 +242,7 @@ impl<
242242
max_size: u64,
243243
concurrency: usize,
244244
label: &'static str,
245-
#[cfg(any(test, feature = "testing"))] pause_client: Option<PauseClient>,
245+
#[cfg(test)] pause_client: Option<PauseClient>,
246246
) -> Self {
247247
let (tx, rx) = new_codel_queue_async(rt.clone(), 200);
248248
let inner = Inner::new(cache, max_size, label, tx);
@@ -254,7 +254,7 @@ impl<
254254
inner,
255255
label,
256256
handle: Arc::new(handle),
257-
#[cfg(any(test, feature = "testing"))]
257+
#[cfg(test)]
258258
pause_client: pause_client
259259
.map(|pause_client| Arc::new(tokio::sync::Mutex::new(pause_client))),
260260
}
@@ -386,7 +386,7 @@ impl<
386386
Status::Ready(value) => Ok(value),
387387
Status::Waiting(rx) => Ok(Self::wait_for_value(key, rx).await?),
388388
Status::Kickoff(rx, timer) => {
389-
#[cfg(any(test, feature = "testing"))]
389+
#[cfg(test)]
390390
if let Some(pause_client) = &mut self.pause_client.clone() {
391391
let pause_client = pause_client.lock().await;
392392
pause_client.wait(PAUSE_DURING_GENERATE_VALUE_LABEL).await;

0 commit comments

Comments
 (0)