don't use rlua::prelude

This commit is contained in:
Andy Weidenbaum 2021-03-24 16:10:47 +11:00
parent 0b09ac03d6
commit f816aeaf6b

View File

@ -1,4 +1,3 @@
use rlua::prelude::LuaError;
use rlua::{Context, Function, MetaMethod, RegistryKey, Table, UserData, UserDataMethods, Value}; use rlua::{Context, Function, MetaMethod, RegistryKey, Table, UserData, UserDataMethods, Value};
use std::collections::HashMap; use std::collections::HashMap;
use std::fs::File; use std::fs::File;
@ -270,9 +269,9 @@ impl<'a> AddSearcher for Context<'a> {
let transform = Box::new(|path| { let transform = Box::new(|path| {
let mut content = String::new(); let mut content = String::new();
let mut file = File::open(path) let mut file = File::open(path)
.map_err(|e| LuaError::RuntimeError(format!("io error: {:#?}", e)))?; .map_err(|e| rlua::Error::RuntimeError(format!("io error: {:#?}", e)))?;
file.read_to_string(&mut content) file.read_to_string(&mut content)
.map_err(|e| LuaError::RuntimeError(format!("io error: {:#?}", e)))?; .map_err(|e| rlua::Error::RuntimeError(format!("io error: {:#?}", e)))?;
Ok(content) Ok(content)
}); });
self.add_path_searcher_poly(modules, transform) self.add_path_searcher_poly(modules, transform)