From b6cc7a70b7365ddaffee412eae5842a9b61cec82 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 18 Oct 2024 21:29:15 -0400 Subject: [PATCH] Future is not send. --- src/command/build/runner.rs | 2 +- src/command/build/walk_fs.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/command/build/runner.rs b/src/command/build/runner.rs index 4bf1ade..a36c9af 100644 --- a/src/command/build/runner.rs +++ b/src/command/build/runner.rs @@ -61,7 +61,7 @@ async fn get_output_directory(config: &Config) -> Result { Ok(output_directory) } -fn filter_to_post_directories(entry: &DirEntry) -> Result { +async fn filter_to_post_directories(entry: &DirEntry) -> Result { Ok(true) } diff --git a/src/command/build/walk_fs.rs b/src/command/build/walk_fs.rs index a214941..0361a70 100644 --- a/src/command/build/walk_fs.rs +++ b/src/command/build/walk_fs.rs @@ -1,3 +1,4 @@ +use std::future::Future; use std::ops::AsyncFn; use std::path::Path; @@ -9,7 +10,10 @@ use crate::error::CustomError; pub(crate) fn walk_fs<'p, P: AsRef + std::marker::Send + 'p>( root: P, - predicate: fn(&DirEntry) -> Result, + predicate: impl AsyncFn(&DirEntry) -> Result + + std::marker::Send + + 'p + + std::marker::Copy, ) -> BoxFuture<'p, Result, CustomError>> { async move { let mut ret = Vec::new(); @@ -20,7 +24,7 @@ pub(crate) fn walk_fs<'p, P: AsRef + std::marker::Send + 'p>( let child_entries = walk_fs(entry.path(), predicate).await?; ret.extend(child_entries); } - if predicate(&entry)? { + if predicate(&entry).await? { ret.push(entry); } }