1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-07-09 15:37:45 +00:00

Address two of "warning: redundant pattern matching, consider using is_ok()"

-We should really refactor this part of the code, it's a bunch of copy paste.
This commit is contained in:
The Dax 2025-07-04 10:32:59 -04:00 committed by Joshua Goins
parent fe25cc6210
commit 72915e11d9

View file

@ -574,7 +574,7 @@ async fn client_loop(
* This is reset -after- running the command intentionally. Resetting beforehand will never display the command's identifier.
*/
let command_sender: Result<mlua::prelude::LuaValue, mlua::prelude::LuaError> = lua.globals().get("command_sender");
if let Ok(_) = command_sender {
if command_sender.is_ok() {
lua.globals().set("command_sender", mlua::Value::Nil)?;
}
Ok(())
@ -674,7 +674,7 @@ async fn client_loop(
* This is reset -after- running the command intentionally. Resetting beforehand will never display the command's identifier.
*/
let command_sender: Result<mlua::prelude::LuaValue, mlua::prelude::LuaError> = lua.globals().get("command_sender");
if let Ok(_) = command_sender {
if command_sender.is_ok() {
lua.globals().set("command_sender", mlua::Value::Nil)?;
}
Ok(())