mononoke: remove BoxStream from walk.rs

Summary: The requirement for boxing is in tail.rs so do the boxing there.

Reviewed By: StanislavGlebik

Differential Revision: D26365153

fbshipit-source-id: 65974fd1e90ca9709ba58200a319ffc6b0fae5db
This commit is contained in:
Alex Hornby 2021-02-10 10:39:53 -08:00 committed by Facebook GitHub Bot
parent 9394e9d035
commit 9ad29a97ed
2 changed files with 4 additions and 5 deletions

View File

@ -253,7 +253,8 @@ where
// Walk needs clonable visitor, so wrap in Arc for its duration
let arc_v = Arc::new(visitor);
let walk_output = walk_exact(ctx, arc_v.clone(), job_params, repo_params, type_params);
let walk_output =
walk_exact(ctx, arc_v.clone(), job_params, repo_params, type_params).boxed();
make_sink(walk_output).await?;
visitor = Arc::try_unwrap(arc_v).map_err(|_| anyhow!("could not unwrap visitor"))?;

View File

@ -34,7 +34,7 @@ use filestore::{self, Alias};
use fsnodes::RootFsnodeId;
use futures::{
future::{self, FutureExt, TryFutureExt},
stream::{BoxStream, StreamExt, TryStreamExt},
stream::{Stream, TryStreamExt},
};
use itertools::{Either, Itertools};
use manifest::{Entry, Manifest};
@ -1598,7 +1598,7 @@ pub fn walk_exact<V, VOut, Route>(
job_params: JobWalkParams,
repo_params: RepoWalkParams,
type_params: RepoWalkTypeParams,
) -> BoxStream<'static, Result<VOut, Error>>
) -> impl Stream<Item = Result<VOut, Error>>
where
V: 'static + Clone + WalkVisitor<VOut, Route> + Send + Sync,
VOut: 'static + Send,
@ -1704,12 +1704,10 @@ where
let handle = tokio::task::spawn(next);
handle.await?
}
.boxed()
}
})
})
.try_flatten_stream()
.boxed()
}
async fn walk_one<V, VOut, Route>(