From 45102409d514ea99dc2d6883445c86a2ea919719 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 16 Jul 2024 10:20:06 +0200 Subject: [PATCH] Use http dependency directly --- Cargo.toml | 1 + src/lib.rs | 4 ++-- src/types.rs | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d6aed5a..33bb5c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ ring = ["dep:ring", "hyper-rustls?/ring", "rcgen/ring"] [dependencies] aws-lc-rs = { version = "1.8.0", optional = true } base64 = "0.21.0" +http = "1" http-body-util = "0.1.2" hyper = { version = "1.3.1", features = ["client", "http1", "http2"] } hyper-rustls = { version = "0.27", default-features = false, features = ["http1", "http2", "native-tokio", "tls12", "rustls-native-certs"], optional = true } diff --git a/src/lib.rs b/src/lib.rs index 1a37f5c..e0f5efc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,10 +9,10 @@ use std::pin::Pin; use std::sync::Arc; use base64::prelude::{Engine, BASE64_URL_SAFE_NO_PAD}; +use http::header::{CONTENT_TYPE, LOCATION}; +use http::{Method, Request, Response, StatusCode}; use http_body_util::{BodyExt, Full}; use hyper::body::{Bytes, Incoming}; -use hyper::header::{CONTENT_TYPE, LOCATION}; -use hyper::{Method, Request, Response, StatusCode}; use hyper_util::client::legacy::connect::Connect; use hyper_util::client::legacy::Client as HyperClient; #[cfg(feature = "hyper-rustls")] diff --git a/src/types.rs b/src/types.rs index c480fb3..27d9b0e 100644 --- a/src/types.rs +++ b/src/types.rs @@ -31,13 +31,13 @@ pub enum Error { CryptoKey(#[from] crypto::KeyRejected), /// HTTP failure #[error("HTTP request failure: {0}")] - Http(#[from] hyper::http::Error), + Http(#[from] http::Error), /// Hyper request failure #[error("HTTP request failure: {0}")] Hyper(#[from] hyper::Error), /// Invalid ACME server URL #[error("invalid URI: {0}")] - InvalidUri(#[from] hyper::http::uri::InvalidUri), + InvalidUri(#[from] http::uri::InvalidUri), /// Failed to (de)serialize a JSON object #[error("failed to (de)serialize JSON: {0}")] Json(#[from] serde_json::Error),