Skip to content

Commit

Permalink
Remove 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 12, 2021
1 parent 672a557 commit ab5ebb9
Showing 1 changed file with 2 additions and 2 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> + Send,
{
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>> + Send,
E: Send + Sync + 'static,
{
let hash = self.base.hash(&key);
Expand Down

0 comments on commit ab5ebb9

Please sign in to comment.