Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Jun 30, 2022
1 parent a89c1cf commit 94817e4
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 31 deletions.
42 changes: 21 additions & 21 deletions arrow-flight/src/arrow.flight.protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::HandshakeRequest>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::HandshakeResponse>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::HandshakeResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand All @@ -308,9 +308,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoRequest<super::Criteria>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::FlightInfo>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::FlightInfo>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand Down Expand Up @@ -389,9 +389,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoRequest<super::Ticket>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::FlightData>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::FlightData>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand All @@ -418,9 +418,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::FlightData>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::PutResult>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::PutResult>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand All @@ -446,9 +446,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::FlightData>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::FlightData>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::FlightData>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand All @@ -475,9 +475,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoRequest<super::Action>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::Result>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::Result>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand All @@ -501,9 +501,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoRequest<super::Empty>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::ActionType>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::ActionType>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand Down
2 changes: 1 addition & 1 deletion arrow/src/array/array_dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub struct DictionaryArray<K: ArrowPrimitiveType> {
is_ordered: bool,
}

impl<'a, K: ArrowPrimitiveType> DictionaryArray<K> {
impl<K: ArrowPrimitiveType> DictionaryArray<K> {
/// Attempt to create a new DictionaryArray with a specified keys
/// (indexes into the dictionary) and values (dictionary)
/// array. Returns an error if there are any keys that are outside
Expand Down
2 changes: 1 addition & 1 deletion arrow/src/array/array_primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ impl<T: ArrowPrimitiveType> From<&Option<<T as ArrowPrimitiveType>::Native>>
}
}

impl<'a, T: ArrowPrimitiveType, Ptr: Into<NativeAdapter<T>>> FromIterator<Ptr>
impl<T: ArrowPrimitiveType, Ptr: Into<NativeAdapter<T>>> FromIterator<Ptr>
for PrimitiveArray<T>
{
fn from_iter<I: IntoIterator<Item = Ptr>>(iter: I) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion arrow/src/array/array_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ where
}
}

impl<'a, Ptr, OffsetSize: OffsetSizeTrait> FromIterator<Option<Ptr>>
impl<Ptr, OffsetSize: OffsetSizeTrait> FromIterator<Option<Ptr>>
for GenericStringArray<OffsetSize>
where
Ptr: AsRef<str>,
Expand Down
4 changes: 1 addition & 3 deletions arrow/src/compute/kernels/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1071,9 +1071,7 @@ mod tests {
fn test_primitive_array_add_mismatched_length() {
let a = Int32Array::from(vec![5, 6, 7, 8, 9]);
let b = Int32Array::from(vec![6, 7, 8]);
let e = add(&a, &b)
.err()
.expect("should have failed due to different lengths");
let e = add(&a, &b).expect_err("should have failed due to different lengths");
assert_eq!(
"ComputeError(\"Cannot perform math operation on arrays of different length\")",
format!("{:?}", e)
Expand Down
3 changes: 2 additions & 1 deletion arrow/src/util/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
//! purposes. See the `pretty` crate for additional functions for
//! record batch pretty printing.

use std::fmt::Write;
use std::sync::Arc;

use crate::array::Array;
Expand Down Expand Up @@ -208,7 +209,7 @@ macro_rules! make_string_hex {
let mut tmp = "".to_string();

for character in array.value($row) {
tmp += &format!("{:02x}", character);
let _ = write!(tmp, "{:02x}", character);
}

tmp
Expand Down
4 changes: 1 addition & 3 deletions parquet/src/encodings/decoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ pub struct DeltaBitPackDecoder<T: DataType> {
initialized: bool,

// Header info

/// The number of values in each block
block_size: usize,
/// The number of values that remain to be read in the current page
Expand All @@ -444,7 +443,6 @@ pub struct DeltaBitPackDecoder<T: DataType> {
values_per_mini_block: usize,

// Per block info

/// The minimum delta in the block
min_delta: T::T,
/// The byte offset of the end of the current block
Expand Down Expand Up @@ -839,7 +837,7 @@ impl<T: DataType> DeltaByteArrayDecoder<T> {
}
}

impl<'m, T: DataType> Decoder<T> for DeltaByteArrayDecoder<T> {
impl<T: DataType> Decoder<T> for DeltaByteArrayDecoder<T> {
fn set_data(&mut self, data: ByteBufferPtr, num_values: usize) -> Result<()> {
match T::get_physical_type() {
Type::BYTE_ARRAY | Type::FIXED_LEN_BYTE_ARRAY => {
Expand Down

0 comments on commit 94817e4

Please sign in to comment.