Skip to main content

distrib_ruby/
error.rs

1// This is free and unencumbered software released into the public domain.
2
3use alloc::{
4    boxed::Box,
5    string::{String, ToString},
6};
7use thiserror::Error;
8
9#[derive(Debug, Error)]
10pub enum LoadGemspecError {
11    #[error(transparent)]
12    Other(#[from] Box<dyn core::error::Error>),
13}
14
15#[cfg(feature = "std")]
16impl From<std::io::Error> for LoadGemspecError {
17    fn from(error: std::io::Error) -> Self {
18        Self::Other(error.into())
19    }
20}
21
22impl From<serde_norway::Error> for LoadGemspecError {
23    fn from(error: serde_norway::Error) -> Self {
24        Self::Other(error.into())
25    }
26}