Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ pin-project-lite = { version = "0.2.16", optional = true }
reqwest = { version = "0.12.22", optional = true, default-features = false, features = ["rustls-tls", "http2", "stream"] }
bytes = { version = "1.10.1", optional = true }
uuid = { version = "1.17.0", features = ["v4"] }
futures-core = "0.3.31"
futures-io = "0.3.31"
futures = "0.3.31"
futures-channel = "0.3.31"
futures-util = { version = "0.3.31", default-features = false, features = ["io"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
jsonwebtoken = { version = "9.3.1", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub trait HttpClient: Clone + Send + Sync {
Body: Serialize + Send + Sync,
Output: DeserializeOwned + 'static + Send,
{
use futures::io::Cursor;
use futures_util::io::Cursor;

self.stream_request(
url,
Expand Down
7 changes: 4 additions & 3 deletions src/reqwest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use std::{

use async_trait::async_trait;
use bytes::{Bytes, BytesMut};
use futures::{AsyncRead, Stream};
use futures_core::Stream;
use futures_io::AsyncRead;
use pin_project_lite::pin_project;
use serde::{de::DeserializeOwned, Serialize};

Expand Down Expand Up @@ -90,10 +91,10 @@ impl HttpClient for ReqwestClient {
}
#[cfg(target_arch = "wasm32")]
{
use futures::{pin_mut, AsyncReadExt};
use futures_util::AsyncReadExt;

let mut buf = Vec::new();
pin_mut!(body);
let mut body = std::pin::pin!(body);
body.read_to_end(&mut buf)
.await
.map_err(|err| Error::Other(Box::new(err)))?;
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::time::Duration;

#[cfg(not(target_arch = "wasm32"))]
pub(crate) async fn async_sleep(interval: Duration) {
let (sender, receiver) = futures::channel::oneshot::channel::<()>();
let (sender, receiver) = futures_channel::oneshot::channel::<()>();
std::thread::spawn(move || {
std::thread::sleep(interval);
let _ = sender.send(());
Expand Down