diff --git a/arrow-buffer/src/alloc/alignment.rs b/arrow-buffer/src/alloc/alignment.rs index 1bd15c54b990..7978baa2bbd8 100644 --- a/arrow-buffer/src/alloc/alignment.rs +++ b/arrow-buffer/src/alloc/alignment.rs @@ -18,7 +18,7 @@ // NOTE: Below code is written for spatial/temporal prefetcher optimizations. Memory allocation // should align well with usage pattern of cache access and block sizes on layers of storage levels from // registers to non-volatile memory. These alignments are all cache aware alignments incorporated -// from [cuneiform](https://crates.io/crates/cuneiform) crate. This approach mimicks Intel TBB's +// from [cuneiform](https://crates.io/crates/cuneiform) crate. This approach mimics Intel TBB's // cache_aligned_allocator which exploits cache locality and minimizes prefetch signals // resulting in less round trip time between the layers of storage. // For further info: https://software.intel.com/en-us/node/506094 diff --git a/arrow-data/src/data.rs b/arrow-data/src/data.rs index b53e9f0af4de..902bfbf67239 100644 --- a/arrow-data/src/data.rs +++ b/arrow-data/src/data.rs @@ -751,7 +751,7 @@ impl ArrayData { ) -> Result<&[T], ArrowError> { let buffer = &self.buffers[idx]; - let required_len = (len + self.offset) * std::mem::size_of::(); + let required_len = (len + self.offset) * mem::size_of::(); if buffer.len() < required_len { return Err(ArrowError::InvalidArgumentError(format!( @@ -1170,7 +1170,7 @@ impl ArrayData { // This should have been checked as part of `validate()` prior // to calling `validate_full()` but double check to be sure - assert!(buffer.len() / std::mem::size_of::() >= required_len); + assert!(buffer.len() / mem::size_of::() >= required_len); // Justification: buffer size was validated above let indexes: &[T] = diff --git a/arrow-flight/build.rs b/arrow-flight/build.rs index 4ceb298359db..bc20100ab37f 100644 --- a/arrow-flight/build.rs +++ b/arrow-flight/build.rs @@ -64,7 +64,7 @@ fn main() -> Result<(), Box> { let proto_path = Path::new("../format/FlightSql.proto"); tonic_build::configure() - // protoc in unbuntu builder needs this option + // protoc in ubuntu builder needs this option .protoc_arg("--experimental_allow_proto3_optional") .out_dir("src/sql") .compile(&[proto_path], &[proto_dir])?; diff --git a/arrow-flight/src/lib.rs b/arrow-flight/src/lib.rs index 054981707085..1f4bcc6c434c 100644 --- a/arrow-flight/src/lib.rs +++ b/arrow-flight/src/lib.rs @@ -292,7 +292,7 @@ fn schema_to_ipc_format(schema_ipc: SchemaAsIpc) -> ArrowResult { let encoded_data = flight_schema_as_encoded_data(pair.0, pair.1); let mut schema = vec![]; - arrow::ipc::writer::write_message(&mut schema, encoded_data, pair.1)?; + writer::write_message(&mut schema, encoded_data, pair.1)?; Ok(IpcMessage(schema)) } diff --git a/arrow-flight/src/sql/mod.rs b/arrow-flight/src/sql/mod.rs index cd198a1401d1..30bdcb5604ff 100644 --- a/arrow-flight/src/sql/mod.rs +++ b/arrow-flight/src/sql/mod.rs @@ -137,7 +137,7 @@ impl ProstAnyExt for prost_types::Any { if !self.is::() { return Ok(None); } - let m = prost::Message::decode(&*self.value).map_err(|err| { + let m = Message::decode(&*self.value).map_err(|err| { ArrowError::ParseError(format!("Unable to decode Any value: {}", err)) })?; Ok(Some(m)) diff --git a/arrow-flight/src/sql/server.rs b/arrow-flight/src/sql/server.rs index f3208d376497..525c721aa2b5 100644 --- a/arrow-flight/src/sql/server.rs +++ b/arrow-flight/src/sql/server.rs @@ -41,9 +41,7 @@ static CLOSE_PREPARED_STATEMENT: &str = "ClosePreparedStatement"; /// Implements FlightSqlService to handle the flight sql protocol #[tonic::async_trait] -pub trait FlightSqlService: - std::marker::Sync + std::marker::Send + std::marker::Sized + 'static -{ +pub trait FlightSqlService: Sync + Send + Sized + 'static { /// When impl FlightSqlService, you can always set FlightService to Self type FlightService: FlightService; @@ -276,7 +274,7 @@ pub trait FlightSqlService: #[tonic::async_trait] impl FlightService for T where - T: FlightSqlService + std::marker::Send, + T: FlightSqlService + Send, { type HandshakeStream = Pin> + Send + 'static>>; @@ -413,7 +411,7 @@ where &self, request: Request, ) -> Result, Status> { - let msg: prost_types::Any = prost::Message::decode(&*request.get_ref().ticket) + let msg: prost_types::Any = Message::decode(&*request.get_ref().ticket) .map_err(decode_error_to_status)?; fn unpack(msg: prost_types::Any) -> Result { @@ -465,7 +463,7 @@ where ) -> Result, Status> { let cmd = request.get_mut().message().await?.unwrap(); let message: prost_types::Any = - prost::Message::decode(&*cmd.flight_descriptor.unwrap().cmd) + Message::decode(&*cmd.flight_descriptor.unwrap().cmd) .map_err(decode_error_to_status)?; if message.is::() { let token = message @@ -474,7 +472,7 @@ where .expect("unreachable"); let record_count = self.do_put_statement_update(token, request).await?; let result = DoPutUpdateResult { record_count }; - let output = futures::stream::iter(vec![Ok(super::super::gen::PutResult { + let output = futures::stream::iter(vec![Ok(PutResult { app_metadata: result.encode_to_vec(), })]); return Ok(Response::new(Box::pin(output))); @@ -495,7 +493,7 @@ where .do_put_prepared_statement_update(handle, request) .await?; let result = DoPutUpdateResult { record_count }; - let output = futures::stream::iter(vec![Ok(super::super::gen::PutResult { + let output = futures::stream::iter(vec![Ok(PutResult { app_metadata: result.encode_to_vec(), })]); return Ok(Response::new(Box::pin(output))); @@ -587,10 +585,10 @@ where } } -fn decode_error_to_status(err: prost::DecodeError) -> tonic::Status { - tonic::Status::invalid_argument(format!("{:?}", err)) +fn decode_error_to_status(err: prost::DecodeError) -> Status { + Status::invalid_argument(format!("{:?}", err)) } -fn arrow_error_to_status(err: arrow::error::ArrowError) -> tonic::Status { - tonic::Status::internal(format!("{:?}", err)) +fn arrow_error_to_status(err: arrow::error::ArrowError) -> Status { + Status::internal(format!("{:?}", err)) } diff --git a/arrow-schema/src/error.rs b/arrow-schema/src/error.rs index 105d4d5e21f0..0d7a35a9dee2 100644 --- a/arrow-schema/src/error.rs +++ b/arrow-schema/src/error.rs @@ -50,19 +50,19 @@ impl ArrowError { } } -impl From<::std::io::Error> for ArrowError { +impl From for ArrowError { fn from(error: std::io::Error) -> Self { ArrowError::IoError(error.to_string()) } } -impl From<::std::string::FromUtf8Error> for ArrowError { +impl From for ArrowError { fn from(error: std::string::FromUtf8Error) -> Self { ArrowError::ParseError(error.to_string()) } } -impl From<::std::io::IntoInnerError> for ArrowError { +impl From> for ArrowError { fn from(error: std::io::IntoInnerError) -> Self { ArrowError::IoError(error.to_string()) }