Skip to content

Commit c3601b8

Browse files
committed
fix: support old stable Error trait
1 parent 8cc6771 commit c3601b8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/http/module.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ pub enum MergeConfigError {
1212
NoValue,
1313
}
1414

15-
impl core::error::Error for MergeConfigError {}
15+
#[cfg(feature = "std")]
16+
impl std::error::Error for MergeConfigError {}
1617

1718
impl core::fmt::Display for MergeConfigError {
1819
fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {

src/http/request.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use core::error::Error;
21
use core::ffi::c_void;
32
use core::fmt;
43
use core::marker::PhantomData;
@@ -718,7 +717,8 @@ impl fmt::Display for InvalidMethod {
718717
}
719718
}
720719

721-
impl Error for InvalidMethod {}
720+
#[cfg(feature = "std")]
721+
impl std::error::Error for InvalidMethod {}
722722

723723
#[derive(Clone, PartialEq, Eq, Hash)]
724724
enum MethodInner {

src/http/status.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use core::error::Error;
21
use core::fmt;
32

43
use crate::core::Status;
@@ -29,7 +28,8 @@ impl fmt::Display for InvalidHTTPStatusCode {
2928
}
3029
}
3130

32-
impl Error for InvalidHTTPStatusCode {}
31+
#[cfg(feature = "std")]
32+
impl std::error::Error for InvalidHTTPStatusCode {}
3333

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

0 commit comments

Comments
 (0)