From d2e5faa2113723267a395cfc6cb44c574b07e2fd Mon Sep 17 00:00:00 2001 From: cat_or_not <41955154+catornot@users.noreply.github.com> Date: Tue, 1 Oct 2024 21:47:16 -0400 Subject: [PATCH] fix clippy warnings --- src/high/squirrel.rs | 2 +- src/mid/engine/concommands.rs | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) 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; }) } }