Skip to content

Commit 3271079

Browse files
committed
Implement core Error for PldmError and mctp::Error
core::error was added in Rust 1.81. Signed-off-by: Matt Johnston <[email protected]>
1 parent 6aebf7b commit 3271079

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

mctp/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ pub enum Error {
190190
Io(std::io::Error),
191191
}
192192

193-
#[cfg(feature = "std")]
194-
impl std::error::Error for Error {}
193+
impl core::error::Error for Error {}
195194

196195
impl core::fmt::Display for Error {
197196
fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {

pldm/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ impl core::fmt::Display for PldmError {
5050
}
5151
}
5252

53-
#[cfg(feature = "std")]
54-
impl std::error::Error for PldmError {
55-
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
53+
impl core::error::Error for PldmError {
54+
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
5655
match self {
5756
Self::Mctp(s) => Some(s),
5857
_ => None,

0 commit comments

Comments
 (0)