This is an automated email from the ASF dual-hosted git repository.

tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/master by this push:
     new 3db7f427e minor: remove redundant prefix (#2983)
3db7f427e is described below

commit 3db7f427ec6b41c910958dc0333cc298405628eb
Author: jakevin <[email protected]>
AuthorDate: Mon Oct 31 12:35:55 2022 +0800

    minor: remove redundant prefix (#2983)
    
    * minor: remove redundant prefix
    
    * typo
---
 arrow-buffer/src/alloc/alignment.rs |  2 +-
 arrow-data/src/data.rs              |  4 ++--
 arrow-flight/build.rs               |  2 +-
 arrow-flight/src/lib.rs             |  2 +-
 arrow-flight/src/sql/mod.rs         |  2 +-
 arrow-flight/src/sql/server.rs      | 22 ++++++++++------------
 arrow-schema/src/error.rs           |  6 +++---
 7 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/arrow-buffer/src/alloc/alignment.rs 
b/arrow-buffer/src/alloc/alignment.rs
index 1bd15c54b..7978baa2b 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 b53e9f0af..902bfbf67 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::<T>();
+        let required_len = (len + self.offset) * mem::size_of::<T>();
 
         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::<T>() >= required_len);
+        assert!(buffer.len() / mem::size_of::<T>() >= required_len);
 
         // Justification: buffer size was validated above
         let indexes: &[T] =
diff --git a/arrow-flight/build.rs b/arrow-flight/build.rs
index 4ceb29835..bc20100ab 100644
--- a/arrow-flight/build.rs
+++ b/arrow-flight/build.rs
@@ -64,7 +64,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
         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 054981707..1f4bcc6c4 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<IpcMessage> {
     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 cd198a140..30bdcb560 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::<M>() {
             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 f3208d376..525c721aa 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<T: 'static> FlightService for T
 where
-    T: FlightSqlService + std::marker::Send,
+    T: FlightSqlService + Send,
 {
     type HandshakeStream =
         Pin<Box<dyn Stream<Item = Result<HandshakeResponse, Status>> + Send + 
'static>>;
@@ -413,7 +411,7 @@ where
         &self,
         request: Request<Ticket>,
     ) -> Result<Response<Self::DoGetStream>, 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<T: ProstMessageExt>(msg: prost_types::Any) -> Result<T, 
Status> {
@@ -465,7 +463,7 @@ where
     ) -> Result<Response<Self::DoPutStream>, 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::<CommandStatementUpdate>() {
             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 105d4d5e2..0d7a35a9d 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<std::io::Error> for ArrowError {
     fn from(error: std::io::Error) -> Self {
         ArrowError::IoError(error.to_string())
     }
 }
 
-impl From<::std::string::FromUtf8Error> for ArrowError {
+impl From<std::string::FromUtf8Error> for ArrowError {
     fn from(error: std::string::FromUtf8Error) -> Self {
         ArrowError::ParseError(error.to_string())
     }
 }
 
-impl<W: Write> From<::std::io::IntoInnerError<W>> for ArrowError {
+impl<W: Write> From<std::io::IntoInnerError<W>> for ArrowError {
     fn from(error: std::io::IntoInnerError<W>) -> Self {
         ArrowError::IoError(error.to_string())
     }

Reply via email to