Remove std::fmt::Debug from LuaDebug as it crashes a lot, make i_ci pub

This commit is contained in:
William Venner 2021-10-10 20:03:43 +01:00
parent d1413ea013
commit 8c554cfad9
1 changed files with 2 additions and 21 deletions

View File

@ -92,24 +92,5 @@ pub struct LuaDebug {
pub linedefined: i32, pub linedefined: i32,
pub lastlinedefined: i32, pub lastlinedefined: i32,
pub short_src: [std::os::raw::c_char; LUA_IDSIZE], pub short_src: [std::os::raw::c_char; LUA_IDSIZE],
i_ci: i32 pub i_ci: i32
} }
impl std::fmt::Debug for LuaDebug {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
unsafe {
f.debug_struct("LuaDebug")
.field("event", &self.event)
.field("name", &std::ffi::CStr::from_ptr(self.name))
.field("namewhat", &std::ffi::CStr::from_ptr(self.namewhat))
.field("what", &std::ffi::CStr::from_ptr(self.what))
.field("source", &std::ffi::CStr::from_ptr(self.source))
.field("currentline", &self.currentline)
.field("nups", &self.nups)
.field("linedefined", &self.linedefined)
.field("lastlinedefined", &self.lastlinedefined)
.field("short_src", &std::ffi::CStr::from_ptr(self.short_src.as_ptr()))
.field("i_ci", &self.i_ci)
.finish()
}
}
}