Satisfy msrv by removing then_some.

This commit is contained in:
Stephen Chung
2023-02-21 18:16:03 +08:00
parent c58b52f2cb
commit 14e205cabc
5 changed files with 8 additions and 8 deletions

View File

@@ -1137,7 +1137,7 @@ fn optimize_expr(expr: &mut Expr, state: &mut OptimizerState, _chaining: bool) {
_ if x.args.len() == 2 && x.op_token.is_some() && (state.engine.fast_operators() || !state.engine.has_native_fn_override(x.hashes.native(), &arg_types)) => {
if let Some(result) = get_builtin_binary_op_fn(x.op_token.as_ref().unwrap(), &arg_values[0], &arg_values[1])
.and_then(|(f, ctx)| {
let context = ctx.then_some((state.engine, x.name.as_str(), None, &state.global, *pos).into());
let context = ctx.then(|| (state.engine, x.name.as_str(), None, &state.global, *pos).into());
let (first, second) = arg_values.split_first_mut().unwrap();
(f)(context, &mut [ first, &mut second[0] ]).ok()
}) {