Skip to content

Commit aa56c25

Browse files
committed
These should be not send
1 parent f67f819 commit aa56c25

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/hooks/internal/tasks.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
use dioxus::prelude::*;
44
use std::time::Duration;
55

6-
76
use crate::{
87
cache::ProviderCache,
98
refresh::{RefreshRegistry, TaskType},
@@ -25,7 +24,7 @@ pub fn setup_interval_task_core<P, Param>(
2524
cache: &ProviderCache,
2625
refresh_registry: &RefreshRegistry,
2726
) where
28-
P: Provider<Param> + Clone + Send,
27+
P: Provider<Param> + Clone,
2928
Param: ProviderParamBounds,
3029
{
3130
if let Some(interval) = provider.interval() {
@@ -103,7 +102,7 @@ pub fn setup_cache_expiration_task_core<P, Param>(
103102
cache: &ProviderCache,
104103
refresh_registry: &RefreshRegistry,
105104
) where
106-
P: Provider<Param> + Clone + Send,
105+
P: Provider<Param> + Clone,
107106
Param: ProviderParamBounds,
108107
{
109108
if let Some(expiration) = provider.cache_expiration() {
@@ -195,7 +194,7 @@ pub fn setup_stale_check_task_core<P, Param>(
195194
cache: &ProviderCache,
196195
refresh_registry: &RefreshRegistry,
197196
) where
198-
P: Provider<Param> + Clone + Send,
197+
P: Provider<Param> + Clone,
199198
Param: ProviderParamBounds,
200199
{
201200
if let Some(stale_time) = provider.stale_time() {

src/hooks/provider.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ pub trait UseProvider<Args> {
360360
/// by using the `IntoProviderParam` trait to normalize different parameter formats.
361361
impl<P, Args> UseProvider<Args> for P
362362
where
363-
P: Provider<Args::Param> + Send + Clone,
363+
P: Provider<Args::Param> + Clone,
364364
Args: IntoProviderParam,
365365
{
366366
type Output = P::Output;
@@ -378,7 +378,7 @@ fn use_provider_core<P, Param>(
378378
param: Param,
379379
) -> Signal<ProviderState<P::Output, P::Error>>
380380
where
381-
P: Provider<Param> + Send + Clone,
381+
P: Provider<Param> + Clone,
382382
Param: ProviderParamBounds,
383383
{
384384
let mut state = use_signal(|| ProviderState::Loading {

src/refresh.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl RefreshRegistry {
160160
interval: Duration,
161161
task_fn: F,
162162
) where
163-
F: Fn() + Send + 'static,
163+
F: Fn() + 'static,
164164
{
165165
if let Ok(mut tasks) = self.periodic_tasks.lock() {
166166
let task_key = format!("{key}:{task_type:?}");
@@ -236,7 +236,7 @@ impl RefreshRegistry {
236236
/// This is a convenience method for starting interval refresh tasks.
237237
pub fn start_interval_task<F>(&self, key: &str, interval: Duration, refresh_fn: F)
238238
where
239-
F: Fn() + Send + 'static,
239+
F: Fn() + 'static,
240240
{
241241
self.start_periodic_task(key, TaskType::IntervalRefresh, interval, refresh_fn);
242242
}
@@ -246,7 +246,7 @@ impl RefreshRegistry {
246246
/// This is a convenience method for starting stale checking tasks.
247247
pub fn start_stale_check_task<F>(&self, key: &str, stale_time: Duration, stale_check_fn: F)
248248
where
249-
F: Fn() + Send + 'static,
249+
F: Fn() + 'static,
250250
{
251251
self.start_periodic_task(key, TaskType::StaleCheck, stale_time, stale_check_fn);
252252
}

0 commit comments

Comments
 (0)