Skip to content

Commit

Permalink
fix: impl From<Box<dyn Error>> for ort::Error again; closes #352
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Feb 19, 2025
1 parent a649948 commit b887ca9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ impl fmt::Display for Error {
#[cfg(feature = "std")] // sigh...
impl std::error::Error for Error {}

#[cfg(feature = "std")]
impl From<Box<dyn std::error::Error + Send + Sync + 'static>> for Error {
fn from(err: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Error {
code: ErrorCode::GenericFailure,
msg: err.to_string()
}
}
}

impl From<Infallible> for Error {
fn from(value: Infallible) -> Self {
match value {}
Expand Down

0 comments on commit b887ca9

Please sign in to comment.