diff options
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/interaction.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rust/src/interaction.rs b/rust/src/interaction.rs index ccb5c81a..76fc9275 100644 --- a/rust/src/interaction.rs +++ b/rust/src/interaction.rs @@ -296,7 +296,9 @@ impl FormInputBuilder { result.type_ = BNFormInputFieldType::AddressFormField; result.prompt = prompt.as_ref().as_ptr() as *const c_char; if let Some(view) = view { - result.view = view.handle; + // the view is being moved into result, there is no need to clone + // and drop is intentionally being avoided with `Ref::into_raw` + result.view = unsafe { Ref::into_raw(view) }.handle; } result.currentAddress = current_address.unwrap_or(0); result.hasDefault = default.is_some(); |
