diff --git a/wooting-analog-sdk/src/ffi.rs b/wooting-analog-sdk/src/ffi.rs index 82f0a38..6f0b780 100644 --- a/wooting-analog-sdk/src/ffi.rs +++ b/wooting-analog-sdk/src/ffi.rs @@ -241,8 +241,8 @@ pub extern "C" fn wooting_analog_get_connected_devices_info( devices.truncate(device_no); // Convert all the DeviceInfo's into DeviceInfo_C pointers let c_devices: Vec<*mut DeviceInfo_FFI> = devices - .drain(..) - .map(|dev| Box::into_raw(Box::new(dev.into()))) + .iter() + .map(|dev| Box::into_raw(Box::new((*dev).clone().into()))) .collect(); buff.swap_with_slice(c_devices.clone().as_mut());