@@ -209,14 +209,7 @@ where
209209 }
210210 }
211211
212- self . execute (
213- db,
214- runtime,
215- revision_now,
216- active_query,
217- panic_guard,
218- old_memo,
219- )
212+ self . execute ( db, runtime, revision_now, active_query, panic_guard, old_memo)
220213 }
221214
222215 fn execute (
@@ -232,9 +225,7 @@ where
232225
233226 db. salsa_event ( Event {
234227 runtime_id : db. salsa_runtime ( ) . id ( ) ,
235- kind : EventKind :: WillExecute {
236- database_key : self . database_key_index ,
237- } ,
228+ kind : EventKind :: WillExecute { database_key : self . database_key_index } ,
238229 } ) ;
239230
240231 // Query was not previously executed, or value is potentially
@@ -310,22 +301,12 @@ where
310301 changed_at : revisions. changed_at ,
311302 } ;
312303
313- let memo_value = if self . should_memoize_value ( & self . key ) {
314- Some ( new_value. value . clone ( ) )
315- } else {
316- None
317- } ;
304+ let memo_value =
305+ if self . should_memoize_value ( & self . key ) { Some ( new_value. value . clone ( ) ) } else { None } ;
318306
319- debug ! (
320- "read_upgrade({:?}): result.revisions = {:#?}" ,
321- self , revisions,
322- ) ;
307+ debug ! ( "read_upgrade({:?}): result.revisions = {:#?}" , self , revisions, ) ;
323308
324- panic_guard. proceed ( Some ( Memo {
325- value : memo_value,
326- verified_at : revision_now,
327- revisions,
328- } ) ) ;
309+ panic_guard. proceed ( Some ( Memo { value : memo_value, verified_at : revision_now, revisions } ) ) ;
329310
330311 new_value
331312 }
@@ -388,10 +369,7 @@ where
388369 value : value. clone ( ) ,
389370 } ;
390371
391- info ! (
392- "{:?}: returning memoized value changed at {:?}" ,
393- self , value. changed_at
394- ) ;
372+ info ! ( "{:?}: returning memoized value changed at {:?}" , self , value. changed_at) ;
395373
396374 ProbeState :: UpToDate ( value)
397375 } else {
@@ -503,11 +481,9 @@ where
503481 // If we know when value last changed, we can return right away.
504482 // Note that we don't need the actual value to be available.
505483 ProbeState :: NoValue ( _, changed_at)
506- | ProbeState :: UpToDate ( StampedValue {
507- value : _,
508- durability : _,
509- changed_at,
510- } ) => MaybeChangedSinceProbeState :: ChangedAt ( changed_at) ,
484+ | ProbeState :: UpToDate ( StampedValue { value : _, durability : _, changed_at } ) => {
485+ MaybeChangedSinceProbeState :: ChangedAt ( changed_at)
486+ }
511487
512488 // If we have nothing cached, then value may have changed.
513489 ProbeState :: NotComputed ( _) => MaybeChangedSinceProbeState :: ChangedAt ( revision_now) ,
@@ -561,14 +537,8 @@ where
561537 // We found that this memoized value may have changed
562538 // but we have an old value. We can re-run the code and
563539 // actually *check* if it has changed.
564- let StampedValue { changed_at, .. } = self . execute (
565- db,
566- runtime,
567- revision_now,
568- active_query,
569- panic_guard,
570- Some ( old_memo) ,
571- ) ;
540+ let StampedValue { changed_at, .. } =
541+ self . execute ( db, runtime, revision_now, active_query, panic_guard, Some ( old_memo) ) ;
572542 changed_at > revision
573543 } else {
574544 // We found that inputs to this memoized value may have chanced
@@ -605,10 +575,7 @@ where
605575 Q : QueryFunction ,
606576{
607577 fn in_progress ( id : RuntimeId ) -> Self {
608- QueryState :: InProgress {
609- id,
610- anyone_waiting : Default :: default ( ) ,
611- }
578+ QueryState :: InProgress { id, anyone_waiting : Default :: default ( ) }
612579 }
613580}
614581
@@ -632,11 +599,7 @@ where
632599 slot : & ' me Slot < Q , MP > ,
633600 runtime : & ' me Runtime ,
634601 ) -> Self {
635- Self {
636- database_key_index,
637- slot,
638- runtime,
639- }
602+ Self { database_key_index, slot, runtime }
640603 }
641604
642605 /// Indicates that we have concluded normally (without panicking).
@@ -674,8 +637,7 @@ where
674637 // acquire a mutex; the mutex will guarantee that all writes
675638 // we are interested in are visible.
676639 if anyone_waiting. load ( Ordering :: Relaxed ) {
677- self . runtime
678- . unblock_queries_blocked_on ( self . database_key_index , wait_result) ;
640+ self . runtime . unblock_queries_blocked_on ( self . database_key_index , wait_result) ;
679641 }
680642 }
681643 _ => panic ! (
@@ -784,9 +746,8 @@ where
784746 // are only interested in finding out whether the
785747 // input changed *again*.
786748 QueryInputs :: Tracked { inputs } => {
787- let changed_input = inputs
788- . iter ( )
789- . find ( |& & input| db. maybe_changed_after ( input, verified_at) ) ;
749+ let changed_input =
750+ inputs. iter ( ) . find ( |& & input| db. maybe_changed_after ( input, verified_at) ) ;
790751 if let Some ( input) = changed_input {
791752 debug ! ( "validate_memoized_value: `{:?}` may have changed" , input) ;
792753
0 commit comments