From aa1db9551e90cd878efabca0c9382fb438a074a3 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sun, 6 Oct 2024 13:45:44 -0700 Subject: [PATCH] match has better line width balance --- src/runner/instance.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/runner/instance.rs b/src/runner/instance.rs index 2d96e06..396752b 100644 --- a/src/runner/instance.rs +++ b/src/runner/instance.rs @@ -402,13 +402,13 @@ struct ClassMethods<'a>{ impl ClassMethods<'_>{ /// return self.methods[index] or create the function in the hashmap and then return it fn get_or_create_function(&mut self,lua:&mlua::Lua,index:&str)->mlua::Result>{ - if let Some((&static_index_str,function_pointer))=self.method_pointers.get_entry(index){ - return Ok(Some( + Ok(match self.method_pointers.get_entry(index){ + Some((&static_index_str,function_pointer))=>Some( self.methods.entry(static_index_str) .or_insert(lua.create_function(function_pointer)?) .clone() - )) - } - return Ok(None) + ), + None=>None, + }) } }