summaryrefslogtreecommitdiff
path: root/ext/http/fly_accept_encoding.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/http/fly_accept_encoding.rs')
-rw-r--r--ext/http/fly_accept_encoding.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/ext/http/fly_accept_encoding.rs b/ext/http/fly_accept_encoding.rs
index af687c254..d48410d41 100644
--- a/ext/http/fly_accept_encoding.rs
+++ b/ext/http/fly_accept_encoding.rs
@@ -3,7 +3,6 @@
// Forked from https://github.com/superfly/accept-encoding/blob/1cded757ec7ff3916e5bfe7441db76cdc48170dc/
// Forked to support both http 0.3 and http 1.0 crates.
-use http as http_02;
use itertools::Itertools;
/// A list enumerating the categories of errors in this crate.
@@ -78,10 +77,10 @@ pub fn preferred(
///
/// Compatible with `http` crate for version 0.2.x.
pub fn encodings_iter_http_02(
- headers: &http_02::HeaderMap,
+ headers: &http_v02::HeaderMap,
) -> impl Iterator<Item = Result<(Option<Encoding>, f32), EncodingError>> + '_ {
let iter = headers
- .get_all(http_02::header::ACCEPT_ENCODING)
+ .get_all(http_v02::header::ACCEPT_ENCODING)
.iter()
.map(|hval| hval.to_str().map_err(|_| EncodingError::InvalidEncoding));
encodings_iter_inner(iter)
@@ -91,10 +90,10 @@ pub fn encodings_iter_http_02(
///
/// Compatible with `http` crate for version 1.x.
pub fn encodings_iter_http_1(
- headers: &http_1::HeaderMap,
+ headers: &http::HeaderMap,
) -> impl Iterator<Item = Result<(Option<Encoding>, f32), EncodingError>> + '_ {
let iter = headers
- .get_all(http_1::header::ACCEPT_ENCODING)
+ .get_all(http::header::ACCEPT_ENCODING)
.iter()
.map(|hval| hval.to_str().map_err(|_| EncodingError::InvalidEncoding));
encodings_iter_inner(iter)
@@ -126,9 +125,9 @@ fn encodings_iter_inner<'s>(
#[cfg(test)]
mod tests {
use super::*;
- use http::header::ACCEPT_ENCODING;
- use http::HeaderMap;
- use http::HeaderValue;
+ use http_v02::header::ACCEPT_ENCODING;
+ use http_v02::HeaderMap;
+ use http_v02::HeaderValue;
fn encodings(
headers: &HeaderMap,