Don't need to hard-code static lifetime.

This commit is contained in:
Tom Alexander 2024-10-18 21:23:22 -04:00
parent ae3add9c81
commit 8868cfb63f
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -7,10 +7,10 @@ use tokio::fs::DirEntry;
use crate::error::CustomError;
pub(crate) fn walk_fs<P: AsRef<Path> + std::marker::Send + 'static>(
pub(crate) fn walk_fs<'p, P: AsRef<Path> + std::marker::Send + 'p>(
root: P,
predicate: fn(&DirEntry) -> Result<bool, CustomError>,
) -> BoxFuture<'static, Result<Vec<DirEntry>, CustomError>> {
) -> BoxFuture<'p, Result<Vec<DirEntry>, CustomError>> {
async move {
let mut ret = Vec::new();
let mut entries = tokio::fs::read_dir(root).await?;