Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove clippy unnecessary wraps suppresions in cast kernel #449

Merged
merged 1 commit into from
Jun 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions arrow/src/compute/kernels/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,6 @@ const EPOCH_DAYS_FROM_CE: i32 = 719_163;
/// Arrays should have the same primitive data type, otherwise this should fail.
/// We do not perform this check on primitive data types as we only use this
/// function internally, where it is guaranteed to be infallible.
#[allow(clippy::unnecessary_wraps)]
fn cast_array_data<TO>(array: &ArrayRef, to_type: DataType) -> Result<ArrayRef>
where
TO: ArrowNumericType,
Expand All @@ -974,7 +973,6 @@ where
}

/// Convert Array into a PrimitiveArray of type, and apply numeric cast
#[allow(clippy::unnecessary_wraps)]
fn cast_numeric_arrays<FROM, TO>(from: &ArrayRef) -> Result<ArrayRef>
where
FROM: ArrowNumericType,
Expand Down Expand Up @@ -1006,7 +1004,6 @@ where
}

/// Cast numeric types to Utf8
#[allow(clippy::unnecessary_wraps)]
fn cast_numeric_to_string<FROM, OffsetSize>(array: &ArrayRef) -> Result<ArrayRef>
where
FROM: ArrowNumericType,
Expand Down Expand Up @@ -1035,7 +1032,6 @@ where
}

/// Cast numeric types to Utf8
#[allow(clippy::unnecessary_wraps)]
fn cast_string_to_numeric<T, Offset: StringOffsetSizeTrait>(
from: &ArrayRef,
cast_options: &CastOptions,
Expand Down Expand Up @@ -1101,7 +1097,6 @@ where
}

/// Casts generic string arrays to Date32Array
#[allow(clippy::unnecessary_wraps)]
fn cast_string_to_date32<Offset: StringOffsetSizeTrait>(
array: &dyn Array,
cast_options: &CastOptions,
Expand Down Expand Up @@ -1164,7 +1159,6 @@ fn cast_string_to_date32<Offset: StringOffsetSizeTrait>(
}

/// Casts generic string arrays to Date64Array
#[allow(clippy::unnecessary_wraps)]
fn cast_string_to_date64<Offset: StringOffsetSizeTrait>(
array: &dyn Array,
cast_options: &CastOptions,
Expand Down Expand Up @@ -1226,7 +1220,6 @@ fn cast_string_to_date64<Offset: StringOffsetSizeTrait>(
}

/// Casts generic string arrays to TimeStampNanosecondArray
#[allow(clippy::unnecessary_wraps)]
fn cast_string_to_timestamp_ns<Offset: StringOffsetSizeTrait>(
array: &dyn Array,
cast_options: &CastOptions,
Expand Down Expand Up @@ -1308,7 +1301,6 @@ where
/// Cast Boolean types to numeric
///
/// `false` returns 0 while `true` returns 1
#[allow(clippy::unnecessary_wraps)]
fn cast_bool_to_numeric<TO>(
from: &ArrayRef,
cast_options: &CastOptions,
Expand Down