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/test/Cargo.toml b/lib/rs/test/Cargo.toml
index dc4ffe3..decc985 100644
--- a/lib/rs/test/Cargo.toml
+++ b/lib/rs/test/Cargo.toml
@@ -1,6 +1,7 @@
[package]
name = "kitchen-sink"
version = "0.1.0"
+edition = "2018"
license = "Apache-2.0"
authors = ["Apache Thrift Developers <dev@thrift.apache.org>"]
publish = false
diff --git a/lib/rs/test/Makefile.am b/lib/rs/test/Makefile.am
index 486188c..5dc4f56 100644
--- a/lib/rs/test/Makefile.am
+++ b/lib/rs/test/Makefile.am
@@ -41,6 +41,8 @@
-$(RM) src/base_two.rs
-$(RM) src/midlayer.rs
-$(RM) src/ultimate.rs
+ -$(RM) src/recursive.rs
+ -$(RM) src/identifiers.rs
-$(RM) -r bin
EXTRA_DIST = \
diff --git a/lib/rs/test/src/bin/kitchen_sink_client.rs b/lib/rs/test/src/bin/kitchen_sink_client.rs
index d295c88..a777920 100644
--- a/lib/rs/test/src/bin/kitchen_sink_client.rs
+++ b/lib/rs/test/src/bin/kitchen_sink_client.rs
@@ -69,7 +69,7 @@
TFramedWriteTransport::new(o_chan),
);
- let (i_prot, o_prot): (Box<TInputProtocol>, Box<TOutputProtocol>) = match protocol {
+ let (i_prot, o_prot): (Box<dyn TInputProtocol>, Box<dyn TOutputProtocol>) = match protocol {
"binary" => (
Box::new(TBinaryInputProtocol::new(i_tran, true)),
Box::new(TBinaryOutputProtocol::new(o_tran, true)),
@@ -86,8 +86,8 @@
fn run_client(
service: &str,
- i_prot: Box<TInputProtocol>,
- o_prot: Box<TOutputProtocol>,
+ i_prot: Box<dyn TInputProtocol>,
+ o_prot: Box<dyn TOutputProtocol>,
) -> thrift::Result<()> {
match service {
"full" => exec_full_meal_client(i_prot, o_prot),
@@ -110,8 +110,8 @@
}
fn exec_meal_client(
- i_prot: Box<TInputProtocol>,
- o_prot: Box<TOutputProtocol>,
+ i_prot: Box<dyn TInputProtocol>,
+ o_prot: Box<dyn TOutputProtocol>,
) -> thrift::Result<()> {
let mut client = MealServiceSyncClient::new(i_prot, o_prot);
@@ -127,8 +127,8 @@
}
fn exec_full_meal_client(
- i_prot: Box<TInputProtocol>,
- o_prot: Box<TOutputProtocol>,
+ i_prot: Box<dyn TInputProtocol>,
+ o_prot: Box<dyn TOutputProtocol>,
) -> thrift::Result<()> {
let mut client = FullMealServiceSyncClient::new(i_prot, o_prot);
@@ -141,8 +141,8 @@
}
fn exec_recursive_client(
- i_prot: Box<TInputProtocol>,
- o_prot: Box<TOutputProtocol>,
+ i_prot: Box<dyn TInputProtocol>,
+ o_prot: Box<dyn TOutputProtocol>,
) -> thrift::Result<()> {
let mut client = recursive::TestServiceSyncClient::new(i_prot, o_prot);
diff --git a/lib/rs/test/src/bin/kitchen_sink_server.rs b/lib/rs/test/src/bin/kitchen_sink_server.rs
index 73801ea..c53e887 100644
--- a/lib/rs/test/src/bin/kitchen_sink_server.rs
+++ b/lib/rs/test/src/bin/kitchen_sink_server.rs
@@ -76,8 +76,8 @@
let w_transport_factory = TFramedWriteTransportFactory::new();
let (i_protocol_factory, o_protocol_factory): (
- Box<TInputProtocolFactory>,
- Box<TOutputProtocolFactory>,
+ Box<dyn TInputProtocolFactory>,
+ Box<dyn TOutputProtocolFactory>,
) = match &*protocol {
"binary" => (
Box::new(TBinaryInputProtocolFactory::new()),