From fa2f66e2c0d4bbfbfe6cce1ffeba25aabd48d8b4 Mon Sep 17 00:00:00 2001 From: tottoto Date: Sun, 14 Apr 2024 01:57:06 +0900 Subject: [PATCH] refactor use of futures-util crate (#59) --- Cargo.toml | 2 +- src/client.rs | 2 +- src/response_body.rs | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ae124d4..1d3b7d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" base64 = "0.22.0" byteorder = "1.5.0" bytes = "1.5.0" -futures-util = "0.3.30" +futures-util = { version = "0.3.30", default-features = false } http = "0.2.11" http-body = "0.4.6" httparse = "1.8.0" diff --git a/src/client.rs b/src/client.rs index b0a82e9..4e8491e 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1,9 +1,9 @@ use std::{ + future::Future, pin::Pin, task::{Context, Poll}, }; -use futures_util::Future; use http::{Request, Response}; use tonic::body::BoxBody; use tower_service::Service; diff --git a/src/response_body.rs b/src/response_body.rs index 6662572..28d11cb 100644 --- a/src/response_body.rs +++ b/src/response_body.rs @@ -1,13 +1,12 @@ use std::{ ops::{Deref, DerefMut}, pin::Pin, - task::{Context, Poll}, + task::{ready, Context, Poll}, }; use base64::{prelude::BASE64_STANDARD, Engine}; use byteorder::{BigEndian, ByteOrder}; use bytes::{BufMut, Bytes, BytesMut}; -use futures_util::ready; use http::{header::HeaderName, HeaderMap, HeaderValue}; use http_body::Body; use httparse::{Status, EMPTY_HEADER};