Skip to content

Commit be1e847

Browse files
committed
Implement core::error::Error without std
1 parent 59d5204 commit be1e847

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ categories = ["os", "no-std"]
1212
exclude = [".*"]
1313

1414
[features]
15-
# Implement std::error::Error for getrandom::Error and
15+
# Implement From<getrandom::Error> for std::io::Error and
1616
# use std to retrieve OS error descriptions
1717
std = []
1818

src/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ impl Error {
185185
}
186186
}
187187

188+
impl core::error::Error for Error {}
189+
188190
impl fmt::Debug for Error {
189191
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
190192
let mut dbg = f.debug_struct("Error");

src/error_std_impls.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ impl From<Error> for io::Error {
1111
}
1212
}
1313
}
14-
15-
impl std::error::Error for Error {}

0 commit comments

Comments
 (0)