From 8028cf7fd4e772eb09204f1daf033116ac02ea4a Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Wed, 29 May 2024 15:36:28 +0200 Subject: [PATCH] remove another useless clone in use_context_provider --- packages/hooks/src/use_context.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/hooks/src/use_context.rs b/packages/hooks/src/use_context.rs index 4e248e93ae..33aed61f7f 100644 --- a/packages/hooks/src/use_context.rs +++ b/packages/hooks/src/use_context.rs @@ -58,7 +58,6 @@ pub fn use_context() -> T { /// ``` pub fn use_context_provider(f: impl FnOnce() -> T) -> T { use_hook(|| { - let val = f(); - provide_context(val.clone()) + provide_context(f()) }) }