From 98fa43575d1ba0045584ebbc3ea693bb6253954f Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 18 Oct 2024 21:19:40 -0400 Subject: [PATCH] Require boxing?. --- src/command/build/runner.rs | 2 +- src/command/build/walk_fs.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/command/build/runner.rs b/src/command/build/runner.rs index a36c9af..4bf1ade 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) } -async fn filter_to_post_directories(entry: &DirEntry) -> Result { +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 7b427ee..9795ca1 100644 --- a/src/command/build/walk_fs.rs +++ b/src/command/build/walk_fs.rs @@ -5,19 +5,19 @@ use tokio::fs::DirEntry; use crate::error::CustomError; -pub(crate) async fn walk_fs, F: AsyncFn(&DirEntry) -> Result>( +pub(crate) async fn walk_fs>( root: P, - predicate: F, + predicate: fn(&DirEntry) -> Result, ) -> Result, CustomError> { let mut ret = Vec::new(); let mut entries = tokio::fs::read_dir(root).await?; while let Some(entry) = entries.next_entry().await? { let file_type = entry.file_type().await?; if file_type.is_dir() { - let child_entries = walk_fs(entry.path(), &predicate).await?; + let child_entries = walk_fs(entry.path(), predicate).await?; ret.extend(child_entries); } - if predicate(&entry).await? { + if predicate(&entry)? { ret.push(entry); } }