s/RLua/Lua

This commit is contained in:
Andy Weidenbaum 2021-02-04 12:40:14 +11:00
parent fbb1942093
commit d74b008050

View File

@ -1,18 +1,18 @@
#[derive(Debug)]
pub enum Error {
RLua(rlua::Error),
Lua(rlua::Error),
}
impl From<rlua::Error> for Error {
fn from(error: rlua::Error) -> Self {
Error::RLua(error)
Error::Lua(error)
}
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let res = match self {
Error::RLua(e) => format!("rlua error:\n{:#?}", e),
Error::Lua(e) => format!("rlua error:\n{:#?}", e),
};
write!(f, "{}", res)
}