diff --git a/src/high/squirrel.rs b/src/high/squirrel.rs index cf50c0f..1fc0bf6 100644 --- a/src/high/squirrel.rs +++ b/src/high/squirrel.rs @@ -290,7 +290,7 @@ impl UserData { } /// Creates a new [`UserData`] from boxed data - pub fn from_boxed(userdata: Box) -> Self { + pub const fn from_boxed(userdata: Box) -> Self { Self(userdata) } } diff --git a/src/mid/engine/concommands.rs b/src/mid/engine/concommands.rs index 3bb3d3a..e776fda 100644 --- a/src/mid/engine/concommands.rs +++ b/src/mid/engine/concommands.rs @@ -81,12 +81,9 @@ impl RegisterConCommands { ) -> ::std::os::raw::c_int, ) -> Result<*mut ConCommand, RegisterError> { self.mid_register_concommand(name, callback, help_string, flags) - .map(move |command| { - unsafe { - (*command).m_pCompletionCallback = Some(completion_callback); - (*command).m_nCallbackFlags |= 0x3; - } - command + .inspect(move |command| unsafe { + (*(*command)).m_pCompletionCallback = Some(completion_callback); + (*(*command)).m_nCallbackFlags |= 0x3; }) } }