Reformat rust code using 1.40 rustfmt and fail build if rustfmt fails (#2339)
diff --git a/lib/rs/src/server/mod.rs b/lib/rs/src/server/mod.rs
index 050feee..64c6da2 100644
--- a/lib/rs/src/server/mod.rs
+++ b/lib/rs/src/server/mod.rs
@@ -91,7 +91,8 @@
/// the response to `o`.
///
/// Returns `()` if the handler was executed; `Err` otherwise.
- fn process(&self, i: &mut dyn TInputProtocol, o: &mut dyn TOutputProtocol) -> crate::Result<()>;
+ fn process(&self, i: &mut dyn TInputProtocol, o: &mut dyn TOutputProtocol)
+ -> crate::Result<()>;
}
/// Convenience function used in generated `TProcessor` implementations to
diff --git a/lib/rs/src/server/multiplexed.rs b/lib/rs/src/server/multiplexed.rs
index 4f41f24..8331d91 100644
--- a/lib/rs/src/server/multiplexed.rs
+++ b/lib/rs/src/server/multiplexed.rs
@@ -136,7 +136,11 @@
}
impl TProcessor for TMultiplexedProcessor {
- fn process(&self, i_prot: &mut dyn TInputProtocol, o_prot: &mut dyn TOutputProtocol) -> crate::Result<()> {
+ fn process(
+ &self,
+ i_prot: &mut dyn TInputProtocol,
+ o_prot: &mut dyn TOutputProtocol,
+ ) -> crate::Result<()> {
let msg_ident = i_prot.read_message_begin()?;
debug!("process incoming msg id:{:?}", &msg_ident);
@@ -183,7 +187,9 @@
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
- use crate::protocol::{TBinaryInputProtocol, TBinaryOutputProtocol, TMessageIdentifier, TMessageType};
+ use crate::protocol::{
+ TBinaryInputProtocol, TBinaryOutputProtocol, TMessageIdentifier, TMessageType,
+ };
use crate::transport::{ReadHalf, TBufferChannel, TIoChannel, WriteHalf};
use crate::{ApplicationError, ApplicationErrorKind};
@@ -261,7 +267,11 @@
}
impl TProcessor for Service {
- fn process(&self, _: &mut dyn TInputProtocol, _: &mut dyn TOutputProtocol) -> crate::Result<()> {
+ fn process(
+ &self,
+ _: &mut dyn TInputProtocol,
+ _: &mut dyn TOutputProtocol,
+ ) -> crate::Result<()> {
let res = self
.invoked
.compare_and_swap(false, true, Ordering::Relaxed);
diff --git a/lib/rs/src/server/threaded.rs b/lib/rs/src/server/threaded.rs
index 64bf8bb..897235c 100644
--- a/lib/rs/src/server/threaded.rs
+++ b/lib/rs/src/server/threaded.rs
@@ -21,7 +21,9 @@
use std::sync::Arc;
use threadpool::ThreadPool;
-use crate::protocol::{TInputProtocol, TInputProtocolFactory, TOutputProtocol, TOutputProtocolFactory};
+use crate::protocol::{
+ TInputProtocol, TInputProtocolFactory, TOutputProtocol, TOutputProtocolFactory,
+};
use crate::transport::{TIoChannel, TReadTransportFactory, TTcpChannel, TWriteTransportFactory};
use crate::{ApplicationError, ApplicationErrorKind};
@@ -196,7 +198,10 @@
fn new_protocols_for_connection(
&mut self,
stream: TcpStream,
- ) -> crate::Result<(Box<dyn TInputProtocol + Send>, Box<dyn TOutputProtocol + Send>)> {
+ ) -> crate::Result<(
+ Box<dyn TInputProtocol + Send>,
+ Box<dyn TOutputProtocol + Send>,
+ )> {
// create the shared tcp stream
let channel = TTcpChannel::with_stream(stream);
@@ -227,10 +232,11 @@
let mut o_prot = o_prot;
loop {
match processor.process(&mut *i_prot, &mut *o_prot) {
- Ok(()) => {},
+ Ok(()) => {}
Err(err) => {
match err {
- crate::Error::Transport(ref transport_err) if transport_err.kind == TransportErrorKind::EndOfFile => {},
+ crate::Error::Transport(ref transport_err)
+ if transport_err.kind == TransportErrorKind::EndOfFile => {}
other => warn!("processor completed with error: {:?}", other),
}
break;