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.
24 lines
444 B
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 {}
|
|
|