Skip to content

Commit

Permalink
fix lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
wangfenjin committed Jul 8, 2023
1 parent 876ee1d commit 0eeacf9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions libduckdb-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ mod error;
mod tests {
use super::*;
use std::{
convert::TryFrom,
ffi::{CStr, CString},
mem,
os::raw::c_char,
ptr,
};

use arrow::{
array::{Array, ArrayData, Int32Array, StructArray},
array::{Array, Int32Array, StructArray},
datatypes::DataType,
ffi::{ArrowArray, FFI_ArrowArray, FFI_ArrowSchema},
ffi::{from_ffi, FFI_ArrowArray, FFI_ArrowSchema},
};

unsafe fn print_int_result(mut result: duckdb_result) {
Expand Down Expand Up @@ -104,8 +103,7 @@ mod tests {
{
panic!("SELECT error")
}
let arrow_array = ArrowArray::new(arrays, schema);
let array_data = ArrayData::try_from(arrow_array).expect("ok");
let array_data = from_ffi(arrays, &schema).expect("ok");
let struct_array = StructArray::from(array_data);
assert_eq!(struct_array.len(), 3);
assert_eq!(struct_array.columns().len(), 2);
Expand Down

0 comments on commit 0eeacf9

Please sign in to comment.