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/transport/buffered.rs b/lib/rs/src/transport/buffered.rs
index b33eb4f..914a19b 100644
--- a/lib/rs/src/transport/buffered.rs
+++ b/lib/rs/src/transport/buffered.rs
@@ -264,7 +264,7 @@
use std::io::{Read, Write};
use super::*;
- use transport::TBufferChannel;
+ use crate::transport::TBufferChannel;
#[test]
fn must_return_zero_if_read_buffer_is_empty() {
diff --git a/lib/rs/src/transport/framed.rs b/lib/rs/src/transport/framed.rs
index 98ad1bb..c30ccd9 100644
--- a/lib/rs/src/transport/framed.rs
+++ b/lib/rs/src/transport/framed.rs
@@ -239,7 +239,7 @@
#[cfg(test)]
mod tests {
use super::*;
- use transport::mem::TBufferChannel;
+ use crate::transport::mem::TBufferChannel;
// FIXME: test a forced reserve
diff --git a/lib/rs/src/transport/mem.rs b/lib/rs/src/transport/mem.rs
index 9874257..68fb265 100644
--- a/lib/rs/src/transport/mem.rs
+++ b/lib/rs/src/transport/mem.rs
@@ -139,7 +139,7 @@
}
impl TIoChannel for TBufferChannel {
- fn split(self) -> ::Result<(ReadHalf<Self>, WriteHalf<Self>)>
+ fn split(self) -> crate::Result<(ReadHalf<Self>, WriteHalf<Self>)>
where
Self: Sized,
{
diff --git a/lib/rs/src/transport/mod.rs b/lib/rs/src/transport/mod.rs
index 32c0799..d02a87c 100644
--- a/lib/rs/src/transport/mod.rs
+++ b/lib/rs/src/transport/mod.rs
@@ -111,7 +111,7 @@
/// Returned halves may share the underlying OS channel or buffer resources.
/// Implementations **should ensure** that these two halves can be safely
/// used independently by concurrent threads.
- fn split(self) -> ::Result<(::transport::ReadHalf<Self>, ::transport::WriteHalf<Self>)>
+ fn split(self) -> crate::Result<(crate::transport::ReadHalf<Self>, crate::transport::WriteHalf<Self>)>
where
Self: Sized;
}
diff --git a/lib/rs/src/transport/socket.rs b/lib/rs/src/transport/socket.rs
index a2e567e..275bcd4 100644
--- a/lib/rs/src/transport/socket.rs
+++ b/lib/rs/src/transport/socket.rs
@@ -21,7 +21,7 @@
use std::net::{Shutdown, TcpStream, ToSocketAddrs};
use super::{ReadHalf, TIoChannel, WriteHalf};
-use {new_transport_error, TransportErrorKind};
+use crate::{new_transport_error, TransportErrorKind};
/// Bidirectional TCP/IP channel.
///
@@ -82,7 +82,7 @@
}
/// Connect to `remote_address`, which should implement `ToSocketAddrs` trait.
- pub fn open<A: ToSocketAddrs>(&mut self, remote_address: A) -> ::Result<()> {
+ pub fn open<A: ToSocketAddrs>(&mut self, remote_address: A) -> crate::Result<()> {
if self.stream.is_some() {
Err(new_transport_error(
TransportErrorKind::AlreadyOpen,
@@ -103,7 +103,7 @@
///
/// Both send and receive halves are closed, and this instance can no
/// longer be used to communicate with another endpoint.
- pub fn close(&mut self) -> ::Result<()> {
+ pub fn close(&mut self) -> crate::Result<()> {
self.if_set(|s| s.shutdown(Shutdown::Both))
.map_err(From::from)
}
@@ -124,7 +124,7 @@
}
impl TIoChannel for TTcpChannel {
- fn split(self) -> ::Result<(ReadHalf<Self>, WriteHalf<Self>)>
+ fn split(self) -> crate::Result<(ReadHalf<Self>, WriteHalf<Self>)>
where
Self: Sized,
{