use core::fmt;
use std::error;
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum TryFromLuaValueError {
KeyCannotBeNan,
KeyCannotBeNull,
}
impl fmt::Display for TryFromLuaValueError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::KeyCannotBeNan => write!(
f,
"LuaMapKey can't be constructed from LuaValue::Number that is NaN"
),
Self::KeyCannotBeNull => {
write!(f, "LuaMapKey can't be constructed from LuaValue::Null")
}
}
}
}
impl error::Error for TryFromLuaValueError {}