Fix some warnings
This commit is contained in:
parent
2fe5dca6c4
commit
9b542fb523
|
@ -1,6 +1,6 @@
|
|||
use std::borrow::{Borrow, Cow};
|
||||
|
||||
use crate::{FromLua, FromLuaVec, Function, IntoLuaVec, State};
|
||||
use crate::{FromLuaVec, Function, IntoLuaVec, State};
|
||||
|
||||
pub struct Chunk<'a> {
|
||||
state: &'a State,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use crate::{Error, PushToLuaStack, Result, StackGuard, State};
|
||||
use crate::{Error, PushToLuaStack, Result, State};
|
||||
|
||||
use mlua_sys as lua;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use core::ffi;
|
||||
use std::{alloc::{self, Layout}, any::TypeId, cell::RefCell, collections::HashMap, ffi::{CStr, CString}, mem, ptr::{self, NonNull}, str::Utf8Error, sync::Arc};
|
||||
|
||||
use lua::{lua_State, lua_gc};
|
||||
use lua::lua_gc;
|
||||
use mlua_sys as lua;
|
||||
|
||||
use crate::{lua_error_guard, proxy::UserdataProxy, AnyUserdata, AsLua, Chunk, Error, FromLua, FromLuaStack, FromLuaVec, Function, IntoChunkData, IntoLuaVec, LuaRef, MetaMethod, PushToLuaStack, Result, StackGuard, Table, Userdata, UserdataBuilder, Value, ValueVec};
|
||||
|
@ -98,7 +98,6 @@ impl<const N: usize> From<&[StdLibrary; N]> for StdLibraries {
|
|||
/// A struct that is used as an upvalue for creating Lua callable functions
|
||||
struct ClosureData<'a> {
|
||||
wrapper_fn: Box<dyn Fn(&'a State, i32) -> i32>,
|
||||
state: NonNull<State>,
|
||||
}
|
||||
|
||||
//#[derive(Default)]
|
||||
|
@ -435,7 +434,6 @@ impl State {
|
|||
|
||||
let data = ClosureData {
|
||||
wrapper_fn: Box::new(wrapper_fn),
|
||||
state: NonNull::from(self),
|
||||
};
|
||||
|
||||
let s = self.state_ptr();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{AsLua, State, Userdata, UserdataBuilder, Value};
|
||||
use crate::{State, Userdata, UserdataBuilder};
|
||||
|
||||
pub struct UserdataProxy<T: Userdata>(PhantomData<T>);
|
||||
|
||||
|
|
|
@ -369,8 +369,6 @@ impl<'a> ValueVec<'a> {
|
|||
/// Gets a ValueVec from the stack with a limit
|
||||
pub fn from_stack_limit(state: &'a State, limit: usize) -> crate::Result<ValueVec<'a>> {
|
||||
unsafe {
|
||||
let s = state.state_ptr();
|
||||
|
||||
let mut vec = VecDeque::new();
|
||||
for _ in 1..(limit + 1) {
|
||||
let v = Value::from_lua_stack(state)?;
|
||||
|
|
Loading…
Reference in New Issue