Added better panic message when calling Effect::deps_gatherer multiple times.

This commit is contained in:
Filipe Rodrigues 2025-05-28 05:24:09 +01:00
parent b2caabf5f3
commit 24844a58d7
Signed by: zenithsiz
SSH Key Fingerprint: SHA256:Mb5ppb3Sh7IarBO/sBTXLHbYEOz37hJAlslLQPPAPaU

View File

@ -188,7 +188,11 @@ impl<F: ?Sized, W: ReactiveWorld> Effect<F, W> {
W::EffectStack::push(self.downgrade());
// Lock the dependencies gatherer
let gather_deps_lock = self.inner.gather_deps_lock.write();
let gather_deps_lock = self
.inner
.gather_deps_lock
.try_write()
.expect("Cannot gather effect dependencies recursively");
// Clear the dependencies
let mut deps = self.inner.dependencies.write();