diff options
author | kyren <kerriganw@gmail.com> | 2018-08-05 09:51:39 -0400 |
---|---|---|
committer | kyren <kerriganw@gmail.com> | 2018-08-05 09:51:39 -0400 |
commit | 2e1bdb64c0ff9855f8769a1673dd5c2c7cd2c872 (patch) | |
tree | 3d56f722a35ae918edb88e94f9548ddd3174a2ee /src/lua.rs | |
parent | e6688e1db293e24dafc65ca28efd2fca59799941 (diff) | |
download | mlua-2e1bdb64c0ff9855f8769a1673dd5c2c7cd2c872.zip |
format with up-to-date rustfmt
Diffstat (limited to 'src/lua.rs')
-rw-r--r-- | src/lua.rs | 30 |
1 files changed, 16 insertions, 14 deletions
@@ -1,28 +1,29 @@ -use std::{mem, ptr, str}; -use std::sync::{Arc, Mutex}; +use std::any::TypeId; use std::cell::{RefCell, UnsafeCell}; +use std::collections::HashMap; use std::ffi::CString; -use std::any::TypeId; use std::marker::PhantomData; -use std::collections::HashMap; use std::os::raw::{c_char, c_int, c_void}; +use std::sync::{Arc, Mutex}; +use std::{mem, ptr, str}; use libc; -use ffi; use error::{Error, Result}; -use util::{assert_stack, callback_error, check_stack, gc_guard, get_userdata, get_wrapped_error, - init_error_metatables, main_state, pop_error, protect_lua, protect_lua_closure, - push_string, push_userdata, push_wrapped_error, safe_pcall, safe_xpcall, - userdata_destructor, StackGuard}; -use value::{FromLua, FromLuaMulti, MultiValue, Nil, ToLua, ToLuaMulti, Value}; -use types::{Callback, Integer, LightUserData, LuaRef, Number, RegistryKey}; +use ffi; +use function::Function; +use scope::Scope; use string::String; use table::Table; -use function::Function; use thread::Thread; +use types::{Callback, Integer, LightUserData, LuaRef, Number, RegistryKey}; use userdata::{AnyUserData, MetaMethod, UserData, UserDataMethods}; -use scope::Scope; +use util::{ + assert_stack, callback_error, check_stack, gc_guard, get_userdata, get_wrapped_error, + init_error_metatables, main_state, pop_error, protect_lua, protect_lua_closure, push_string, + push_userdata, push_wrapped_error, safe_pcall, safe_xpcall, userdata_destructor, StackGuard, +}; +use value::{FromLua, FromLuaMulti, MultiValue, Nil, ToLua, ToLuaMulti, Value}; /// Top level Lua struct which holds the Lua state itself. pub struct Lua { @@ -285,7 +286,8 @@ impl Lua { { let func = RefCell::new(func); self.create_function(move |lua, args| { - (&mut *func.try_borrow_mut() + (&mut *func + .try_borrow_mut() .map_err(|_| Error::RecursiveMutCallback)?)(lua, args) }) } |