List.get with negative index in repl

This commit is contained in:
Folkert 2024-01-28 22:19:30 +01:00
parent 917e0e2027
commit b0d57587e3
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
8 changed files with 109 additions and 33 deletions

View file

@ -117,14 +117,13 @@ impl<'a> ReplApp<'a> for CliApp {
main_fn_name: &str,
ret_bytes: usize,
mut transform: F,
) -> T
) -> Option<T>
where
F: FnMut(&'a Self::Memory, usize) -> T,
Self::Memory: 'a,
{
run_jit_function_dynamic_type!(self.lib, main_fn_name, ret_bytes, |v| transform(
&CliMemory, v
))
let mut t = |v| transform(&CliMemory, v);
run_jit_function_dynamic_type!(self.lib, main_fn_name, ret_bytes, t)
}
}