Skip to content

Commit

Permalink
remove another useless clone in use_context_provider
Browse files Browse the repository at this point in the history
  • Loading branch information
ealmloff authored May 29, 2024
1 parent ecc4f38 commit 8028cf7
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 @@ -58,7 +58,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())
provide_context(f())
})
}

0 comments on commit 8028cf7

Please sign in to comment.