THRIFT-5158 Update Rust generator and Rust lib,test,tutorial to only support 2018 edition
Client: rs
Patch: Allen George
This closes #2078
diff --git a/lib/rs/src/server/threaded.rs b/lib/rs/src/server/threaded.rs
index 5e253f7..8373c46 100644
--- a/lib/rs/src/server/threaded.rs
+++ b/lib/rs/src/server/threaded.rs
@@ -19,12 +19,12 @@
use std::sync::Arc;
use threadpool::ThreadPool;
-use protocol::{TInputProtocol, TInputProtocolFactory, TOutputProtocol, TOutputProtocolFactory};
-use transport::{TIoChannel, TReadTransportFactory, TTcpChannel, TWriteTransportFactory};
-use {ApplicationError, ApplicationErrorKind};
+use crate::protocol::{TInputProtocol, TInputProtocolFactory, TOutputProtocol, TOutputProtocolFactory};
+use crate::transport::{TIoChannel, TReadTransportFactory, TTcpChannel, TWriteTransportFactory};
+use crate::{ApplicationError, ApplicationErrorKind};
use super::TProcessor;
-use TransportErrorKind;
+use crate::TransportErrorKind;
/// Fixed-size thread-pool blocking Thrift server.
///
@@ -169,7 +169,7 @@
///
/// Return `Err` when the server cannot bind to `listen_address` or there
/// is an unrecoverable error.
- pub fn listen<A: ToSocketAddrs>(&mut self, listen_address: A) -> ::Result<()> {
+ pub fn listen<A: ToSocketAddrs>(&mut self, listen_address: A) -> crate::Result<()> {
let listener = TcpListener::bind(listen_address)?;
for stream in listener.incoming() {
match stream {
@@ -185,7 +185,7 @@
}
}
- Err(::Error::Application(ApplicationError {
+ Err(crate::Error::Application(ApplicationError {
kind: ApplicationErrorKind::Unknown,
message: "aborted listen loop".into(),
}))
@@ -194,7 +194,7 @@
fn new_protocols_for_connection(
&mut self,
stream: TcpStream,
- ) -> ::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);
@@ -228,7 +228,7 @@
Ok(()) => {},
Err(err) => {
match err {
- ::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;