Files
benilla-octo/crates/benilla-m2/src/error.rs
T
SamandClaude Fable 5 2ad0043523 benilla: initial public release
A from-scratch World of Warcraft 1.12.1 client in Rust + Bevy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 14:27:01 +07:00

23 lines
648 B
Rust

//! The crate's parse error type.
/// M2 parse error.
#[derive(Debug)]
pub enum Error {
NotMd20,
UnsupportedVersion(u32),
Truncated,
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::NotMd20 => write!(f, "not an MD20 model"),
Error::UnsupportedVersion(v) => {
write!(f, "unsupported M2 version {v} (expected 256..=263)")
}
Error::Truncated => write!(f, "truncated M2"),
}
}
}
impl std::error::Error for Error {}
pub(crate) type Result<T> = std::result::Result<T, Error>;