Fix some warnings
This commit is contained in:
parent
2fe5dca6c4
commit
9b542fb523
|
@ -1,6 +1,6 @@
|
||||||
use std::borrow::{Borrow, Cow};
|
use std::borrow::{Borrow, Cow};
|
||||||
|
|
||||||
use crate::{FromLua, FromLuaVec, Function, IntoLuaVec, State};
|
use crate::{FromLuaVec, Function, IntoLuaVec, State};
|
||||||
|
|
||||||
pub struct Chunk<'a> {
|
pub struct Chunk<'a> {
|
||||||
state: &'a State,
|
state: &'a State,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::{Error, PushToLuaStack, Result, StackGuard, State};
|
use crate::{Error, PushToLuaStack, Result, State};
|
||||||
|
|
||||||
use mlua_sys as lua;
|
use mlua_sys as lua;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use core::ffi;
|
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 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 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};
|
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
|
/// A struct that is used as an upvalue for creating Lua callable functions
|
||||||
struct ClosureData<'a> {
|
struct ClosureData<'a> {
|
||||||
wrapper_fn: Box<dyn Fn(&'a State, i32) -> i32>,
|
wrapper_fn: Box<dyn Fn(&'a State, i32) -> i32>,
|
||||||
state: NonNull<State>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//#[derive(Default)]
|
//#[derive(Default)]
|
||||||
|
@ -435,7 +434,6 @@ impl State {
|
||||||
|
|
||||||
let data = ClosureData {
|
let data = ClosureData {
|
||||||
wrapper_fn: Box::new(wrapper_fn),
|
wrapper_fn: Box::new(wrapper_fn),
|
||||||
state: NonNull::from(self),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let s = self.state_ptr();
|
let s = self.state_ptr();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
use crate::{AsLua, State, Userdata, UserdataBuilder, Value};
|
use crate::{State, Userdata, UserdataBuilder};
|
||||||
|
|
||||||
pub struct UserdataProxy<T: Userdata>(PhantomData<T>);
|
pub struct UserdataProxy<T: Userdata>(PhantomData<T>);
|
||||||
|
|
||||||
|
|
|
@ -369,8 +369,6 @@ impl<'a> ValueVec<'a> {
|
||||||
/// Gets a ValueVec from the stack with a limit
|
/// Gets a ValueVec from the stack with a limit
|
||||||
pub fn from_stack_limit(state: &'a State, limit: usize) -> crate::Result<ValueVec<'a>> {
|
pub fn from_stack_limit(state: &'a State, limit: usize) -> crate::Result<ValueVec<'a>> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let s = state.state_ptr();
|
|
||||||
|
|
||||||
let mut vec = VecDeque::new();
|
let mut vec = VecDeque::new();
|
||||||
for _ in 1..(limit + 1) {
|
for _ in 1..(limit + 1) {
|
||||||
let v = Value::from_lua_stack(state)?;
|
let v = Value::from_lua_stack(state)?;
|
||||||
|
|
Loading…
Reference in New Issue