diff --git a/src/http/module.rs b/src/http/module.rs index fbe9e11..5ba9b1c 100644 --- a/src/http/module.rs +++ b/src/http/module.rs @@ -12,7 +12,8 @@ pub enum MergeConfigError { NoValue, } -impl core::error::Error for MergeConfigError {} +#[cfg(feature = "std")] +impl std::error::Error for MergeConfigError {} impl core::fmt::Display for MergeConfigError { fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { diff --git a/src/http/request.rs b/src/http/request.rs index eb74edb..1ddfb24 100644 --- a/src/http/request.rs +++ b/src/http/request.rs @@ -1,4 +1,3 @@ -use core::error::Error; use core::ffi::c_void; use core::fmt; use core::marker::PhantomData; @@ -718,7 +717,8 @@ impl fmt::Display for InvalidMethod { } } -impl Error for InvalidMethod {} +#[cfg(feature = "std")] +impl std::error::Error for InvalidMethod {} #[derive(Clone, PartialEq, Eq, Hash)] enum MethodInner { diff --git a/src/http/status.rs b/src/http/status.rs index b067a93..ec77a92 100644 --- a/src/http/status.rs +++ b/src/http/status.rs @@ -1,4 +1,3 @@ -use core::error::Error; use core::fmt; use crate::core::Status; @@ -29,7 +28,8 @@ impl fmt::Display for InvalidHTTPStatusCode { } } -impl Error for InvalidHTTPStatusCode {} +#[cfg(feature = "std")] +impl std::error::Error for InvalidHTTPStatusCode {} impl From for Status { fn from(val: HTTPStatus) -> Self {