Browse Source

formatting

tags/v0.3.11-rc1
Shar-jeel-Sajid 10 months ago
parent
commit
c655d1f103
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      libraries/arrow-convert/src/lib.rs

+ 5
- 5
libraries/arrow-convert/src/lib.rs View File

@@ -1,8 +1,8 @@
use arrow::array::{Array, Float32Array, Float64Array, Int32Array, Int64Array, UInt32Array};
use arrow::datatypes::DataType;
use eyre::{eyre, ContextCompat, Result};
use std::ops::{Deref, DerefMut};
use num::NumCast;
use std::ops::{Deref, DerefMut};

mod from_impls;
mod into_impls;
@@ -32,8 +32,8 @@ impl DerefMut for ArrowData {

macro_rules! register_array_handlers {
($(($variant:path, $array_type:ty, $type_name:expr)),* $(,)?) => {
pub fn into_vec<T>(data: &ArrowData) -> Result<Vec<T>>
where
pub fn into_vec<T>(data: &ArrowData) -> Result<Vec<T>>
where
T: Copy + NumCast + 'static,
{
match data.data_type() {
@@ -43,10 +43,10 @@ macro_rules! register_array_handlers {
.as_any()
.downcast_ref()
.context(concat!("series is not ", $type_name))?;
let mut result = Vec::with_capacity(buffer.len());
for &v in buffer.values() {
let converted = NumCast::from(v).ok_or_else(||
let converted = NumCast::from(v).ok_or_else(||
eyre!("Failed to cast value from {} to target type", $type_name))?;
result.push(converted);
}


Loading…
Cancel
Save