Skip to content

Commit

Permalink
fix linting, address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
XiangpengHao committed Mar 18, 2024
1 parent 4c29007 commit 72854c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions arrow-ipc/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fn create_array(
BinaryView | Utf8View => {
let count = variadic_counts
.pop_front()
.expect("Incorrect variadic count!");
.ok_or(ArrowError::IpcError("Incorrect variadic count!".to_owned()))?;
let count = count + 2; // view and null buffer.
let buffers = (0..count)
.map(|_| reader.next_buffer())
Expand Down Expand Up @@ -359,7 +359,7 @@ impl<'a> ArrayReader<'a> {
Utf8View | BinaryView => {
let count = variadic_count
.pop_front()
.expect("Incorrect variadic count!");
.ok_or(ArrowError::IpcError("Incorrect variadic count!".to_owned()))?;
let count = count + 2; // view and null buffer.
for _i in 0..count {
self.skip_buffer()
Expand Down
5 changes: 2 additions & 3 deletions arrow-ipc/src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1895,9 +1895,8 @@ mod tests {
Some(LONG_TEST_STRING.as_bytes()),
];
let binary_array = BinaryViewArray::from_iter(values);
let utf8_array = StringViewArray::from_iter(
vec![Some("foo"), Some("bar"), Some(LONG_TEST_STRING)].into_iter(),
);
let utf8_array =
StringViewArray::from_iter(vec![Some("foo"), Some("bar"), Some(LONG_TEST_STRING)]);
let record_batch = RecordBatch::try_new(
Arc::new(schema.clone()),
vec![Arc::new(binary_array), Arc::new(utf8_array)],
Expand Down

0 comments on commit 72854c4

Please sign in to comment.