From fa4ae23381133fecd8db01f79be1fa01cca6f44b Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sun, 6 Oct 2024 18:20:53 -0700 Subject: [PATCH] remove and_then --- src/runner/instance.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/runner/instance.rs b/src/runner/instance.rs index 222201a..190b88b 100644 --- a/src/runner/instance.rs +++ b/src/runner/instance.rs @@ -267,12 +267,10 @@ impl mlua::UserData for Instance{ database:db, descriptor:Some(class), }; - iter.find_map(|class| - cf.get_or_create_class_methods(&class.name) - .and_then(|mut class_methods| - class_methods.get_or_create_function(lua,index_str).transpose() - ) - ).transpose() + iter.find_map(|class|{ + let mut class_methods=cf.get_or_create_class_methods(&class.name)?; + class_methods.get_or_create_function(lua,index_str).transpose() + }).transpose() })?{ return function.into_lua(lua); }