My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/games/rstnode/rst-client/src/error.rs

24 lines
444 B

//! Various errors that can occur
use std::{
error::Error,
fmt::{self, Display, Formatter},
};
/// Error loading an asset
#[derive(Clone, Debug)]
pub struct LoadError(String);
impl<'s> From<&'s str> for LoadError {
fn from(s: &'s str) -> Self {
Self(s.into())
}
}
impl Display for LoadError {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(f, "{}", self.0)
}
}
impl Error for LoadError {}