Skip to content

Commit

Permalink
fix: Avoid clonning a provided context unnecessarily
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed May 29, 2024
1 parent b3cd4fa commit ecc4f38
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/hooks/src/use_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ pub fn use_context<T: 'static + Clone>() -> T {
pub fn use_context_provider<T: 'static + Clone>(f: impl FnOnce() -> T) -> T {
use_hook(|| {
let val = f();
provide_context(val.clone());
val
provide_context(val.clone())
})
}

0 comments on commit ecc4f38

Please sign in to comment.