Skip to content

Commit

Permalink
feat: add core-error feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Dec 6, 2024
1 parent 9d7047d commit 55031d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/rlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ derive = ["dep:alloy-rlp-derive"]
# Enables `core::net::` implementations always instead of conditionally through `std`.
# Requires Rust 1.77 or newer.
core-net = []
# Enables `core::error::Error` implementations always instead of conditionally through `std`.
# Requires Rust 1.81 or newer.
core-error = []

arrayvec = ["dep:arrayvec"]

Expand Down
2 changes: 2 additions & 0 deletions crates/rlp/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ pub enum Error {
Custom(&'static str),
}

#[cfg(all(feature = "core-net", not(feature = "std")))]
impl core::error::Error for Error {}
#[cfg(feature = "std")]
impl std::error::Error for Error {}

Expand Down

0 comments on commit 55031d0

Please sign in to comment.