diff --git a/Cargo.toml b/Cargo.toml index 3dd238ec..d0c81d5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,6 @@ brotli = ["brotli-decompressor"] [dependencies] base64 = "0.13" -chunked_transfer = "1.2" cookie = { version = "0.16", default-features = false, optional = true} once_cell = "1" url = "2" diff --git a/src/chunked/decoder.rs b/src/chunked/decoder.rs index ef9e11f1..efeb0dcb 100644 --- a/src/chunked/decoder.rs +++ b/src/chunked/decoder.rs @@ -25,7 +25,7 @@ use std::io::Result as IoResult; /// /// # Example /// -/// ``` +/// ```no_compile /// use chunked_transfer::Decoder; /// use std::io::Read; /// diff --git a/src/chunked/encoder.rs b/src/chunked/encoder.rs index dcdd36ef..3f9a59f6 100644 --- a/src/chunked/encoder.rs +++ b/src/chunked/encoder.rs @@ -21,7 +21,7 @@ use std::io::Write; /// /// # Example /// -/// ``` +/// ```no_compile /// use chunked_transfer::Encoder; /// use std::io::Write; /// diff --git a/src/chunked/mod.rs b/src/chunked/mod.rs index 14c39c76..4d85cc40 100644 --- a/src/chunked/mod.rs +++ b/src/chunked/mod.rs @@ -12,7 +12,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. - +#![allow(dead_code)] mod decoder; pub use decoder::Decoder; diff --git a/src/lib.rs b/src/lib.rs index ad8d8134..6d4c931a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -346,6 +346,7 @@ mod agent; mod body; +mod chunked; mod error; mod header; mod middleware; diff --git a/src/pool.rs b/src/pool.rs index ea88a529..3eab4cf7 100644 --- a/src/pool.rs +++ b/src/pool.rs @@ -448,7 +448,6 @@ mod tests { #[cfg(feature = "gzip")] fn read_exact_chunked_gzip() { use crate::response::Compression; - use chunked_transfer::Decoder as ChunkDecoder; use std::io::Cursor; let gz_body = vec![ @@ -476,7 +475,7 @@ mod tests { PoolReturner::new(agent.clone(), PoolKey::from_parts("http", "1.1.1.1", 8080)), ); - let chunked = ChunkDecoder::new(stream); + let chunked = crate::chunked::Decoder::new(stream); let pool_return_read: Box<(dyn Read + Send + Sync + 'static)> = Box::new(PoolReturnRead::new(chunked)); diff --git a/src/response.rs b/src/response.rs index 8867a4af..e5fed5fe 100644 --- a/src/response.rs +++ b/src/response.rs @@ -4,11 +4,11 @@ use std::num::NonZeroUsize; use std::str::FromStr; use std::{fmt, io::BufRead}; -use chunked_transfer::Decoder as ChunkDecoder; use log::debug; use url::Url; use crate::body::SizedReader; +use crate::chunked::Decoder as ChunkDecoder; use crate::error::{Error, ErrorKind::BadStatus}; use crate::header::{get_all_headers, get_header, Header, HeaderLine}; use crate::pool::{PoolReturnRead, PoolReturner}; diff --git a/src/stream.rs b/src/stream.rs index f911afb4..828ce682 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -6,17 +6,15 @@ use std::time::Duration; use std::time::Instant; use std::{fmt, io::Cursor}; -use chunked_transfer::Decoder as ChunkDecoder; - #[cfg(feature = "socks-proxy")] use socks::{TargetAddr, ToTargetAddr}; +use crate::chunked::Decoder as ChunkDecoder; +use crate::error::ErrorKind; use crate::pool::{PoolKey, PoolReturner}; use crate::proxy::Proxy; -use crate::{error::Error, proxy::Proto}; - -use crate::error::ErrorKind; use crate::unit::Unit; +use crate::{error::Error, proxy::Proto}; /// Trait for things implementing [std::io::Read] + [std::io::Write]. Used in [TlsConnector]. pub trait ReadWrite: Read + Write + Send + Sync + fmt::Debug + 'static {