From 9b542fb523a3dc5d2eb77b246136111ad8bc4dd2 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Sun, 18 Feb 2024 23:23:59 -0500 Subject: [PATCH] Fix some warnings --- src/chunk.rs | 2 +- src/lref.rs | 2 +- src/state.rs | 4 +--- src/userdata/proxy.rs | 2 +- src/value.rs | 2 -- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/chunk.rs b/src/chunk.rs index d85323b..12d475a 100755 --- a/src/chunk.rs +++ b/src/chunk.rs @@ -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, diff --git a/src/lref.rs b/src/lref.rs index efa11ae..3f14f24 100755 --- a/src/lref.rs +++ b/src/lref.rs @@ -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; diff --git a/src/state.rs b/src/state.rs index a73949a..4171a44 100755 --- a/src/state.rs +++ b/src/state.rs @@ -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 From<&[StdLibrary; N]> for StdLibraries { /// A struct that is used as an upvalue for creating Lua callable functions struct ClosureData<'a> { wrapper_fn: Box i32>, - state: NonNull, } //#[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(); diff --git a/src/userdata/proxy.rs b/src/userdata/proxy.rs index 69a5b70..83dc259 100755 --- a/src/userdata/proxy.rs +++ b/src/userdata/proxy.rs @@ -1,6 +1,6 @@ use std::marker::PhantomData; -use crate::{AsLua, State, Userdata, UserdataBuilder, Value}; +use crate::{State, Userdata, UserdataBuilder}; pub struct UserdataProxy(PhantomData); diff --git a/src/value.rs b/src/value.rs index f955e78..7a2d800 100755 --- a/src/value.rs +++ b/src/value.rs @@ -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> { unsafe { - let s = state.state_ptr(); - let mut vec = VecDeque::new(); for _ in 1..(limit + 1) { let v = Value::from_lua_stack(state)?;