fix some lints in use on destroy

This commit is contained in:
Evan Almloff 2024-01-19 12:14:06 -06:00
parent 439bc4e9e6
commit 3dce650367

View file

@ -105,7 +105,7 @@ pub fn use_hook_with_cleanup<T: Clone + 'static>(
hook: impl FnOnce() -> T, hook: impl FnOnce() -> T,
cleanup: impl FnOnce(T) + 'static, cleanup: impl FnOnce(T) + 'static,
) -> T { ) -> T {
let value = use_hook(|| hook()); let value = use_hook(hook);
let _value = value.clone(); let _value = value.clone();
use_on_destroy(move || cleanup(_value)); use_on_destroy(move || cleanup(_value));
value value