risp/src/misc.rs

36 lines
672 B
Rust
Raw Normal View History

2024-02-04 16:09:59 +01:00
use std::io;
#[derive(Debug)]
pub struct Error {
msg: String,
}
impl From<ureq::Error> for Error {
fn from(value: ureq::Error) -> Self {
Self {
msg: value.to_string(),
}
}
}
impl From<io::Error> for Error {
fn from(value: io::Error) -> Self {
Self {
msg: value.to_string(),
}
}
}
impl From<serde_json::Error> for Error {
fn from(value: serde_json::Error) -> Self {
Self {
msg: value.to_string(),
}
}
}
impl From<roxmltree::Error> for Error {
fn from(value: roxmltree::Error) -> Self {
Self {
msg: value.to_string(),
}
}
}