Don't need to hard-code static lifetime.
This commit is contained in:
parent
ae3add9c81
commit
8868cfb63f
@ -7,10 +7,10 @@ use tokio::fs::DirEntry;
|
|||||||
|
|
||||||
use crate::error::CustomError;
|
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,
|
root: P,
|
||||||
predicate: fn(&DirEntry) -> Result<bool, CustomError>,
|
predicate: fn(&DirEntry) -> Result<bool, CustomError>,
|
||||||
) -> BoxFuture<'static, Result<Vec<DirEntry>, CustomError>> {
|
) -> BoxFuture<'p, Result<Vec<DirEntry>, CustomError>> {
|
||||||
async move {
|
async move {
|
||||||
let mut ret = Vec::new();
|
let mut ret = Vec::new();
|
||||||
let mut entries = tokio::fs::read_dir(root).await?;
|
let mut entries = tokio::fs::read_dir(root).await?;
|
||||||
|
Loading…
Reference in New Issue
Block a user