Skip to content

Commit cecffb1

Browse files
committed
lint fixes
1 parent de99d5b commit cecffb1

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

turbopack/crates/turbo-tasks/src/effect.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ pub async fn apply_effects(source: impl CollectiblesSource) -> Result<()> {
178178
return Ok(());
179179
}
180180
let span = tracing::info_span!("apply effects", count = effects.len());
181-
APPLY_EFFECT_CONTEXT
181+
APPLY_EFFECTS_CONTEXT
182182
.scope(Default::default(), async move {
183183
// Limit the concurrency of effects
184184
futures::stream::iter(effects)
@@ -262,7 +262,7 @@ impl Effects {
262262
/// Applies all effects that have been captured by this struct.
263263
pub async fn apply(&self) -> Result<()> {
264264
let span = tracing::info_span!("apply effects", count = self.effects.len());
265-
APPLY_EFFECT_CONTEXT
265+
APPLY_EFFECTS_CONTEXT
266266
.scope(Default::default(), async move {
267267
// Limit the concurrency of effects
268268
futures::stream::iter(self.effects.iter())
@@ -279,7 +279,7 @@ impl Effects {
279279

280280
task_local! {
281281
/// The context of the current effects application.
282-
static APPLY_EFFECT_CONTEXT: Mutex<ApplyEffectContext>;
282+
static APPLY_EFFECTS_CONTEXT: Mutex<ApplyEffectContext>;
283283
}
284284

285285
#[derive(Default)]
@@ -289,21 +289,20 @@ pub struct ApplyEffectContext {
289289

290290
impl ApplyEffectContext {
291291
fn with_context<T, F: FnOnce(&mut Self) -> T>(f: F) -> T {
292-
APPLY_EFFECT_CONTEXT
293-
.try_with(|context| f(&mut context.lock()))
292+
APPLY_EFFECTS_CONTEXT
293+
.try_with(|mutex| f(&mut mutex.lock()))
294294
.expect("No effect context found")
295295
}
296296

297297
pub fn set<T: Any + Send + Sync>(value: T) {
298-
Self::with_context(|context| {
299-
context.data.insert(TypeId::of::<T>(), Box::new(value));
298+
Self::with_context(|this| {
299+
this.data.insert(TypeId::of::<T>(), Box::new(value));
300300
})
301301
}
302302

303303
pub fn with<T: Any + Send + Sync, R>(f: impl FnOnce(&mut T) -> R) -> Option<R> {
304-
Self::with_context(|context| {
305-
context
306-
.data
304+
Self::with_context(|this| {
305+
this.data
307306
.get_mut(&TypeId::of::<T>())
308307
.map(|value| {
309308
// Safety: the map is keyed by TypeId
@@ -317,8 +316,8 @@ impl ApplyEffectContext {
317316
insert_with: impl FnOnce() -> T,
318317
f: impl FnOnce(&mut T) -> R,
319318
) -> R {
320-
Self::with_context(|context| {
321-
let value = context.data.entry(TypeId::of::<T>()).or_insert_with(|| {
319+
Self::with_context(|this| {
320+
let value = this.data.entry(TypeId::of::<T>()).or_insert_with(|| {
322321
let value = insert_with();
323322
Box::new(value)
324323
});

0 commit comments

Comments
 (0)