mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-08 11:46:37 +00:00
Remove dep futures-lite
from binstalk-downloader
(#1259)
I planned to replace `futures-util` with `futures-lite`, but it turns out that `reqwest` actually depends on `futures-util`, so there is no point removing it and introduce yet another dependency. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
2fbcf188a7
commit
ac012bdcb2
9 changed files with 8 additions and 23 deletions
|
@ -4,10 +4,7 @@ use std::{
|
|||
};
|
||||
|
||||
use bytes::{Buf, Bytes};
|
||||
use futures_lite::{
|
||||
future::poll_once,
|
||||
stream::{Stream, StreamExt},
|
||||
};
|
||||
use futures_util::{FutureExt, Stream, StreamExt};
|
||||
use tokio::{sync::mpsc, task};
|
||||
|
||||
pub(super) fn extract_with_blocking_task<E, StreamError, S, F, T>(
|
||||
|
@ -77,7 +74,7 @@ where
|
|||
res = &mut task_fut => {
|
||||
// The task finishes before the read task, return early
|
||||
// after checking for errors in read_fut.
|
||||
if let Some(Err(err)) = poll_once(read_fut).await {
|
||||
if let Some(Err(err)) = read_fut.now_or_never() {
|
||||
Err(err)
|
||||
} else {
|
||||
res
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue