Skip to content

Commit

Permalink
Refactored iter_futures function to remove unnecessary Clone requirem…
Browse files Browse the repository at this point in the history
…ent for type T
  • Loading branch information
knassar702 committed Apr 5, 2023
1 parent 65ba421 commit 6124e65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lua/threads/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ use futures::Future;
use futures::{channel::mpsc, sink::SinkExt};
use tokio::sync::RwLock;

pub async fn iter_futures<F, T: Clone, Fut>(target_iter: Vec<T>, target_function: F, workers: usize)
pub async fn iter_futures<F, T, Fut>(target_iter: Vec<T>, target_function: F, workers: usize)
where
F: FnOnce(T) -> Fut + Clone,
Fut: Future<Output = ()>,
T: Clone
{
stream::iter(target_iter)
.for_each_concurrent(workers, |out| {
Expand Down

0 comments on commit 6124e65

Please sign in to comment.