Skip to content

Commit

Permalink
fix: support old stable Error trait
Browse files Browse the repository at this point in the history
  • Loading branch information
JyJyJcr committed Dec 26, 2024
1 parent 8cc6771 commit c3601b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/http/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/http/request.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use core::error::Error;
use core::ffi::c_void;
use core::fmt;
use core::marker::PhantomData;
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/http/status.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use core::error::Error;
use core::fmt;

use crate::core::Status;
Expand Down Expand Up @@ -29,7 +28,8 @@ impl fmt::Display for InvalidHTTPStatusCode {
}
}

impl Error for InvalidHTTPStatusCode {}
#[cfg(feature = "std")]
impl std::error::Error for InvalidHTTPStatusCode {}

impl From<HTTPStatus> for Status {
fn from(val: HTTPStatus) -> Self {
Expand Down

0 comments on commit c3601b8

Please sign in to comment.