Fix clippy warnings
This commit is contained in:
parent
e01af22bac
commit
29c6c9cb58
|
@ -277,9 +277,9 @@ impl<'lua> Function<'lua> {
|
||||||
short_src: ptr_to_cstr_bytes(ar.short_src.as_ptr()).map(|s| s.to_vec()),
|
short_src: ptr_to_cstr_bytes(ar.short_src.as_ptr()).map(|s| s.to_vec()),
|
||||||
#[cfg(feature = "luau")]
|
#[cfg(feature = "luau")]
|
||||||
short_src: ptr_to_cstr_bytes(ar.short_src).map(|s| s.to_vec()),
|
short_src: ptr_to_cstr_bytes(ar.short_src).map(|s| s.to_vec()),
|
||||||
line_defined: ar.linedefined as i32,
|
line_defined: ar.linedefined,
|
||||||
#[cfg(not(feature = "luau"))]
|
#[cfg(not(feature = "luau"))]
|
||||||
last_line_defined: ar.lastlinedefined as i32,
|
last_line_defined: ar.lastlinedefined,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -315,8 +315,7 @@ impl<'lua> Function<'lua> {
|
||||||
|
|
||||||
lua.push_ref(&self.0);
|
lua.push_ref(&self.0);
|
||||||
let data_ptr = &mut data as *mut Vec<u8> as *mut c_void;
|
let data_ptr = &mut data as *mut Vec<u8> as *mut c_void;
|
||||||
let strip = if strip { 1 } else { 0 };
|
ffi::lua_dump(lua.state, writer, data_ptr, strip as i32);
|
||||||
ffi::lua_dump(lua.state, writer, data_ptr, strip);
|
|
||||||
ffi::lua_pop(lua.state, 1);
|
ffi::lua_pop(lua.state, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,9 +106,9 @@ impl<'lua> Debug<'lua> {
|
||||||
short_src: ptr_to_cstr_bytes((*self.ar.get()).short_src.as_ptr()),
|
short_src: ptr_to_cstr_bytes((*self.ar.get()).short_src.as_ptr()),
|
||||||
#[cfg(feature = "luau")]
|
#[cfg(feature = "luau")]
|
||||||
short_src: ptr_to_cstr_bytes((*self.ar.get()).short_src),
|
short_src: ptr_to_cstr_bytes((*self.ar.get()).short_src),
|
||||||
line_defined: (*self.ar.get()).linedefined as i32,
|
line_defined: (*self.ar.get()).linedefined,
|
||||||
#[cfg(not(feature = "luau"))]
|
#[cfg(not(feature = "luau"))]
|
||||||
last_line_defined: (*self.ar.get()).lastlinedefined as i32,
|
last_line_defined: (*self.ar.get()).lastlinedefined,
|
||||||
what: ptr_to_cstr_bytes((*self.ar.get()).what),
|
what: ptr_to_cstr_bytes((*self.ar.get()).what),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ impl<'lua> Debug<'lua> {
|
||||||
"lua_getinfo failed with `l`"
|
"lua_getinfo failed with `l`"
|
||||||
);
|
);
|
||||||
|
|
||||||
(*self.ar.get()).currentline as i32
|
(*self.ar.get()).currentline
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1124,7 +1124,7 @@ impl Lua {
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "lua54")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "lua54")))]
|
||||||
pub fn warning<S: Into<Vec<u8>>>(&self, msg: S, tocont: bool) -> Result<()> {
|
pub fn warning<S: Into<Vec<u8>>>(&self, msg: S, tocont: bool) -> Result<()> {
|
||||||
let msg = CString::new(msg).map_err(|err| Error::RuntimeError(err.to_string()))?;
|
let msg = CString::new(msg).map_err(|err| Error::RuntimeError(err.to_string()))?;
|
||||||
unsafe { ffi::lua_warning(self.state, msg.as_ptr(), if tocont { 1 } else { 0 }) };
|
unsafe { ffi::lua_warning(self.state, msg.as_ptr(), tocont as c_int) };
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2263,7 +2263,7 @@ impl Lua {
|
||||||
}
|
}
|
||||||
|
|
||||||
Value::Boolean(b) => {
|
Value::Boolean(b) => {
|
||||||
ffi::lua_pushboolean(self.state, if b { 1 } else { 0 });
|
ffi::lua_pushboolean(self.state, b as c_int);
|
||||||
}
|
}
|
||||||
|
|
||||||
Value::LightUserData(ud) => {
|
Value::LightUserData(ud) => {
|
||||||
|
|
Loading…
Reference in New Issue