Skip to content

Commit ff9c538

Browse files
committed
fix bug with optionals
1 parent 0513392 commit ff9c538

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

crates/bevy_mod_scripting_bindings/src/function/script_function.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,11 +616,8 @@ fn pop_args_stack_for_arg<A: ArgMeta>(args: &mut VecDeque<ScriptValue>) -> Optio
616616
return Some(ScriptValue::Tuple(VariadicTuple(std::mem::take(args))));
617617
}
618618
}
619-
if let Some(default) = A::default_value() {
620-
return Some(default);
621-
}
622619

623-
args.pop_front()
620+
args.pop_front().or_else(A::default_value)
624621
}
625622

626623
pub(crate) use count;

0 commit comments

Comments
 (0)