Take Receiver by value in ReadableRx::new

It would remove the lifetime and make reasoning the code much easier.

It would also unblock the next commit I am going to make.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-13 01:05:07 +10:00
parent b4e61161f2
commit 8ef1e56fcc
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
2 changed files with 10 additions and 10 deletions

View file

@ -219,11 +219,11 @@ where
extract_impl(
stream,
Box::new(move |mut rx| {
Box::new(move |rx| {
fs::create_dir_all(path.parent().unwrap())?;
extract_compressed_from_readable::<DummyVisitor, _>(
ReadableRx::new(&mut rx),
ReadableRx::new(rx),
fmt,
Op::UnpackToPath(&path),
)
@ -242,8 +242,8 @@ where
{
extract_impl(
stream,
Box::new(move |mut rx| {
extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, Op::Visit(&mut visitor))
Box::new(move |rx| {
extract_compressed_from_readable(ReadableRx::new(rx), fmt, Op::Visit(&mut visitor))
.map(|_| visitor)
}),
)