Skip to content

Commit

Permalink
Remove Send + 'static requirement from get_or_{,try_}insert_with
Browse files Browse the repository at this point in the history
  • Loading branch information
tinou98 committed Dec 13, 2021
1 parent 672a557 commit cbf6d02
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 197 deletions.
4 changes: 2 additions & 2 deletions src/future/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ where
///
pub async fn get_or_insert_with<F>(&self, key: K, init: F) -> V
where
F: Future<Output = V> + Send + 'static,
F: Future<Output = V>,
{
let hash = self.base.hash(&key);
let key = Arc::new(key);
Expand Down Expand Up @@ -455,7 +455,7 @@ where
///
pub async fn get_or_try_insert_with<F, E>(&self, key: K, init: F) -> Result<V, Arc<E>>
where
F: Future<Output = Result<V, E>> + Send + 'static,
F: Future<Output = Result<V, E>>,
E: Send + Sync + 'static,
{
let hash = self.base.hash(&key);
Expand Down
24 changes: 0 additions & 24 deletions tests/ui/future/get_with_non_send_future.rs

This file was deleted.

12 changes: 0 additions & 12 deletions tests/ui/future/get_with_non_send_future.stderr

This file was deleted.

25 changes: 0 additions & 25 deletions tests/ui/future/get_with_non_static_future.rs

This file was deleted.

36 changes: 0 additions & 36 deletions tests/ui/future/get_with_non_static_future.stderr

This file was deleted.

24 changes: 0 additions & 24 deletions tests/ui/future/try_get_with_non_send_future.rs

This file was deleted.

12 changes: 0 additions & 12 deletions tests/ui/future/try_get_with_non_send_future.stderr

This file was deleted.

26 changes: 0 additions & 26 deletions tests/ui/future/try_get_with_non_static_future.rs

This file was deleted.

36 changes: 0 additions & 36 deletions tests/ui/future/try_get_with_non_static_future.stderr

This file was deleted.

0 comments on commit cbf6d02

Please sign in to comment.