Skip to content

Commit ecf26da

Browse files
authored
feat: add core-error feature (#32)
1 parent 9d7047d commit ecf26da

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

crates/rlp/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ derive = ["dep:alloy-rlp-derive"]
3636
# Enables `core::net::` implementations always instead of conditionally through `std`.
3737
# Requires Rust 1.77 or newer.
3838
core-net = []
39+
# Enables `core::error::Error` implementations always instead of conditionally through `std`.
40+
# Requires Rust 1.81 or newer.
41+
core-error = []
3942

4043
arrayvec = ["dep:arrayvec"]
4144

crates/rlp/src/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ pub enum Error {
3333
Custom(&'static str),
3434
}
3535

36+
#[cfg(all(feature = "core-net", not(feature = "std")))]
37+
impl core::error::Error for Error {}
3638
#[cfg(feature = "std")]
3739
impl std::error::Error for Error {}
3840

0 commit comments

Comments
 (0)