From 8868cfb63fe3fa7912ed251e497bb1e7cd6dbbb2 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 18 Oct 2024 21:23:22 -0400 Subject: [PATCH] Don't need to hard-code static lifetime. --- src/command/build/walk_fs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command/build/walk_fs.rs b/src/command/build/walk_fs.rs index 143e811..a214941 100644 --- a/src/command/build/walk_fs.rs +++ b/src/command/build/walk_fs.rs @@ -7,10 +7,10 @@ use tokio::fs::DirEntry; use crate::error::CustomError; -pub(crate) fn walk_fs + std::marker::Send + 'static>( +pub(crate) fn walk_fs<'p, P: AsRef + std::marker::Send + 'p>( root: P, predicate: fn(&DirEntry) -> Result, -) -> BoxFuture<'static, Result, CustomError>> { +) -> BoxFuture<'p, Result, CustomError>> { async move { let mut ret = Vec::new(); let mut entries = tokio::fs::read_dir(root).await?;