import std::fs::File
This commit is contained in:
parent
cf3a90faca
commit
8e25481811
@ -1,6 +1,7 @@
|
|||||||
use rlua::prelude::LuaError;
|
use rlua::prelude::LuaError;
|
||||||
use rlua::{Context, MetaMethod, RegistryKey, Table, UserData, UserDataMethods, Value};
|
use rlua::{Context, MetaMethod, RegistryKey, Table, UserData, UserDataMethods, Value};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use std::fs::File;
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
@ -108,7 +109,7 @@ where
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut content = String::new();
|
let mut content = String::new();
|
||||||
let mut file = std::fs::File::open(path)
|
let mut file = File::open(path)
|
||||||
.map_err(|e| LuaError::RuntimeError(format!("io error: {:#?}", e)))?;
|
.map_err(|e| LuaError::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| LuaError::RuntimeError(format!("io error: {:#?}", e)))?;
|
||||||
|
Loading…
Reference in New Issue
Block a user