Added #[track_caller] to Effect::{run, try_run}.

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

View File

@ -222,6 +222,7 @@ impl<F: ?Sized, W: ReactiveWorld> Effect<F, W> {
}
/// Runs the effect
#[track_caller]
pub fn run(&self)
where
F: EffectRun<W> + Unsize<W::F> + 'static,
@ -240,7 +241,8 @@ impl<F: ?Sized, W: ReactiveWorld> Effect<F, W> {
effect: W::unsize_effect(self.clone()),
_phantom: PhantomData,
};
self.gather_dependencies(move || self.inner.run.run(ctx));
let _gatherer = self.deps_gatherer();
self.inner.run.run(ctx);
}
/// Suppresses this effect from running while calling this function
@ -358,6 +360,7 @@ impl<F: ?Sized, W: ReactiveWorld> WeakEffect<F, W> {
/// Runs this effect, if it exists.
///
/// Returns if the effect still existed
#[track_caller]
pub fn try_run(&self) -> bool
where
F: EffectRun<W> + Unsize<W::F> + 'static,