Skip to content

Commit 2325e32

Browse files
authored
chore: Remove futures crates (#1478)
* chore: Remove futures crates * chore(tonic): Replace pin_utils::pin_mut with tokio::pin
1 parent 02788da commit 2325e32

File tree

18 files changed

+26
-37
lines changed

18 files changed

+26
-37
lines changed

tests/compression/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ version = "0.1.0"
88

99
[dependencies]
1010
bytes = "1"
11-
futures-core = "0.3"
1211
http = "0.2"
1312
http-body = "0.4"
1413
hyper = "0.14.3"

tests/compression/src/util.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use super::*;
22
use bytes::Bytes;
3-
use futures_core::ready;
43
use http_body::Body;
54
use pin_project::pin_project;
65
use std::{
@@ -9,7 +8,7 @@ use std::{
98
atomic::{AtomicUsize, Ordering::SeqCst},
109
Arc,
1110
},
12-
task::{Context, Poll},
11+
task::{ready, Context, Poll},
1312
};
1413
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
1514
use tonic::transport::{server::Connected, Channel};

tonic-web/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ version = "0.9.2"
1717
[dependencies]
1818
base64 = "0.21"
1919
bytes = "1.0"
20-
futures-core = "0.3"
2120
tokio-stream = "0.1"
2221
http = "0.2"
2322
http-body = "0.4"

tonic-web/src/call.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use std::error::Error;
22
use std::pin::Pin;
3-
use std::task::{Context, Poll};
3+
use std::task::{ready, Context, Poll};
44

55
use base64::Engine as _;
66
use bytes::{Buf, BufMut, Bytes, BytesMut};
7-
use futures_core::ready;
87
use http::{header, HeaderMap, HeaderName, HeaderValue};
98
use http_body::{Body, SizeHint};
109
use pin_project::pin_project;

tonic-web/src/client.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
use bytes::Bytes;
2-
use futures_core::ready;
32
use http::header::CONTENT_TYPE;
43
use http::{Request, Response, Version};
54
use http_body::Body;
65
use pin_project::pin_project;
76
use std::error::Error;
87
use std::future::Future;
98
use std::pin::Pin;
10-
use std::task::{Context, Poll};
9+
use std::task::{ready, Context, Poll};
1110
use tower_layer::Layer;
1211
use tower_service::Service;
1312
use tracing::debug;

tonic-web/src/service.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use futures_core::ready;
21
use std::future::Future;
32
use std::pin::Pin;
4-
use std::task::{Context, Poll};
3+
use std::task::{ready, Context, Poll};
54

65
use http::{header, HeaderMap, HeaderValue, Method, Request, Response, StatusCode, Version};
76
use hyper::Body;

tonic/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ transport = [
3737
"channel",
3838
"dep:h2",
3939
"dep:hyper",
40-
"tokio",
40+
"tokio/net",
41+
"tokio/time",
4142
"dep:tower",
4243
"dep:hyper-timeout",
4344
]
@@ -50,10 +51,10 @@ channel = []
5051
[dependencies]
5152
base64 = "0.21"
5253
bytes = "1.0"
53-
futures-util = {version = "0.3", default-features = false}
5454
http = "0.2"
5555
tracing = "0.1"
5656

57+
tokio = "1.0.1"
5758
http-body = "0.4.4"
5859
percent-encoding = "2.1"
5960
pin-project = "1.0.11"
@@ -70,7 +71,6 @@ async-trait = {version = "0.1.13", optional = true}
7071
h2 = {version = "0.3.17", optional = true}
7172
hyper = {version = "0.14.14", features = ["full"], optional = true}
7273
hyper-timeout = {version = "0.4", optional = true}
73-
tokio = {version = "1.0.1", features = ["net", "time"], optional = true}
7474
tokio-stream = "0.1"
7575
tower = {version = "0.4.7", default-features = false, features = ["balance", "buffer", "discover", "limit", "load", "make", "timeout", "util"], optional = true}
7676
axum = {version = "0.6.9", default_features = false, optional = true}

tonic/src/client/grpc.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ use crate::{
66
request::SanitizeHeaders,
77
Code, Request, Response, Status,
88
};
9-
use futures_util::future;
109
use http::{
1110
header::{HeaderValue, CONTENT_TYPE, TE},
1211
uri::{Parts, PathAndQuery, Uri},
1312
};
1413
use http_body::Body;
15-
use std::fmt;
14+
use std::{fmt, future};
1615
use tokio_stream::{Stream, StreamExt};
1716

1817
/// A gRPC client dispatcher.
@@ -240,7 +239,7 @@ impl<T> Grpc<T> {
240239
let (mut parts, body, extensions) =
241240
self.streaming(request, path, codec).await?.into_parts();
242241

243-
futures_util::pin_mut!(body);
242+
tokio::pin!(body);
244243

245244
let message = body
246245
.try_next()

tonic/src/codec/decode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ use super::compression::{decompress, CompressionEncoding};
22
use super::{DecodeBuf, Decoder, DEFAULT_MAX_RECV_MESSAGE_SIZE, HEADER_SIZE};
33
use crate::{body::BoxBody, metadata::MetadataMap, Code, Status};
44
use bytes::{Buf, BufMut, BytesMut};
5-
use futures_util::{future, ready};
65
use http::StatusCode;
76
use http_body::Body;
87
use std::{
9-
fmt,
8+
fmt, future,
109
pin::Pin,
10+
task::ready,
1111
task::{Context, Poll},
1212
};
1313
use tokio_stream::Stream;

tonic/src/codec/encode.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ use super::compression::{compress, CompressionEncoding, SingleMessageCompression
22
use super::{EncodeBuf, Encoder, DEFAULT_MAX_SEND_MESSAGE_SIZE, HEADER_SIZE};
33
use crate::{Code, Status};
44
use bytes::{BufMut, Bytes, BytesMut};
5-
use futures_util::ready;
65
use http::HeaderMap;
76
use http_body::Body;
87
use pin_project::pin_project;
98
use std::{
109
pin::Pin,
11-
task::{Context, Poll},
10+
task::{ready, Context, Poll},
1211
};
1312
use tokio_stream::{Stream, StreamExt};
1413

0 commit comments

Comments
 (0)