Make trampoline results lifetime explicit
@@ -446,8 +446,9 @@ unsafe extern "C" fn string_end_with(mrb: *mut sys::mrb_state, slf: sys::mrb_val
unwrap_interpreter!(mrb, to => guard);
let value = Value::from(slf);
let suffixes = suffixes.iter().map(|&other| Value::from(other));
- match trampoline::end_with(&mut guard, value, suffixes) {
- Ok(result) => result.inner(),
+ let result = trampoline::end_with(&mut guard, value, suffixes);
+ match result {
+ Ok(result) => return result.inner(),
Err(exception) => error::raise(guard, exception),
}
}
@@ -679,8 +680,9 @@ unsafe extern "C" fn string_start_with(mrb: *mut sys::mrb_state, slf: sys::mrb_v
unwrap_interpreter!(mrb, to => guard);
let value = Value::from(slf);
let prefixes = prefixes.iter().map(|&other| Value::from(other));
- match trampoline::start_with(&mut guard, value, prefixes) {
- Ok(result) => result.inner(),
+ let result = trampoline::start_with(&mut guard, value, prefixes);
+ match result {
+ Ok(result) => return result.inner(),
Err(exception) => error::raise(guard, exception),
}
}
