pub type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Reqwest error: {0}")]
Reqwest(#[from] reqwest::Error),
#[error("String error: {0}")]
String(String),
}
impl From<&str> for Error {
fn from(s: &str) -> Self {
Error::String(s.to_string())
}
}
impl From<String> for Error {
fn from(s: String) -> Self {
Error::String(s)
}
}
impl From<&String> for Error {
fn from(s: &String) -> Self {
Error::String(s.to_string())
}
}
pub type BoxError = Box<dyn std::error::Error + Send + Sync + 'static>;