Avoid shadowing call errors in get_indexed_mut

This commit is contained in:
John-John Tedro 2020-07-24 19:10:07 +02:00
parent 333c4e3a2e
commit d920613d57

View File

@ -1052,17 +1052,20 @@ impl Engine {
#[cfg(not(feature = "no_index"))] #[cfg(not(feature = "no_index"))]
_ => { _ => {
let type_name = self.map_type_name(val.type_name()); let val_type_name = val.type_name();
let args = &mut [val, &mut idx]; let args = &mut [val, &mut idx];
self.exec_fn_call( self.exec_fn_call(
state, lib, FN_IDX_GET, true, 0, args, is_ref, true, None, level, state, lib, FN_IDX_GET, true, 0, args, is_ref, true, None, level,
) )
.map(|(v, _)| v.into()) .map(|(v, _)| v.into())
.map_err(|_| { .map_err(|e| match *e {
Box::new(EvalAltResult::ErrorIndexingType( EvalAltResult::ErrorFunctionNotFound(..) => {
type_name.into(), Box::new(EvalAltResult::ErrorIndexingType(
Position::none(), self.map_type_name(val_type_name).into(),
)) Position::none(),
))
}
_ => e,
}) })
} }