Skip to content

Commit 9bcb739

Browse files
committed
comment
1 parent b767340 commit 9bcb739

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

fendermint/app/src/app.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,13 @@ where
421421
// because it hasn't been committed to state store yet.
422422
let mut cache = self.validators_cache.lock().await;
423423
self.modify_exec_state(|s| {
424+
// we need to leave this outside the closure
425+
// otherwise `s`' lifetime would be captured by the
426+
// closure causing unresolvable liftetime conflicts
427+
// this is fine since we execute the future directly
428+
// after calling the generator closure.
424429
let x = ValidatorCache::new_from_state(s);
425-
async move {
430+
async {
426431
*cache = Some(x?);
427432
Ok(())
428433
}

0 commit comments

Comments
 (0)