summaryrefslogtreecommitdiff
path: root/tutorial/rs
diff options
context:
space:
mode:
authorGREATEST Wiggler EvaR! <allen@actioniq.com>2018-11-09 07:54:32 -0500
committerJames E. King III <jking@apache.org>2018-11-12 07:57:43 -0500
commitb57d126157938e5bba4fc55125d73e7ac5bf11a2 (patch)
tree61125d3118eb074c44b574775af9d9983b19b4ff /tutorial/rs
parent6436899e4723d4a22eac107041019aa981226237 (diff)
downloadthrift-b57d126157938e5bba4fc55125d73e7ac5bf11a2.tar.gz
THRIFT-4529: Rust enum variants are now camel-cased
Client: rs
Diffstat (limited to 'tutorial/rs')
-rw-r--r--tutorial/rs/src/bin/tutorial_client.rs4
-rw-r--r--tutorial/rs/src/bin/tutorial_server.rs8
2 files changed, 6 insertions, 6 deletions
diff --git a/tutorial/rs/src/bin/tutorial_client.rs b/tutorial/rs/src/bin/tutorial_client.rs
index 24ab4be06..e7192b616 100644
--- a/tutorial/rs/src/bin/tutorial_client.rs
+++ b/tutorial/rs/src/bin/tutorial_client.rs
@@ -71,7 +71,7 @@ fn run() -> thrift::Result<()> {
// let's do...a multiply!
let res = client
- .calculate(logid, Work::new(7, 8, Operation::MULTIPLY, None))?;
+ .calculate(logid, Work::new(7, 8, Operation::Multiply, None))?;
println!("multiplied 7 and 8 and got {}", res);
// let's get the log for it
@@ -81,7 +81,7 @@ fn run() -> thrift::Result<()> {
// ok - let's be bad :(
// do a divide by 0
// logid doesn't matter; won't be recorded
- let res = client.calculate(77, Work::new(2, 0, Operation::DIVIDE, "we bad".to_owned()));
+ let res = client.calculate(77, Work::new(2, 0, Operation::Divide, "we bad".to_owned()));
// we should have gotten an exception back
match res {
diff --git a/tutorial/rs/src/bin/tutorial_server.rs b/tutorial/rs/src/bin/tutorial_server.rs
index 8db8eed26..171c4ce31 100644
--- a/tutorial/rs/src/bin/tutorial_server.rs
+++ b/tutorial/rs/src/bin/tutorial_server.rs
@@ -134,10 +134,10 @@ impl CalculatorSyncHandler for CalculatorServer {
let num2 = w.num2.as_ref().expect("operands checked");
match *op {
- Operation::ADD => Ok(num1 + num2),
- Operation::SUBTRACT => Ok(num1 - num2),
- Operation::MULTIPLY => Ok(num1 * num2),
- Operation::DIVIDE => {
+ Operation::Add => Ok(num1 + num2),
+ Operation::Subtract => Ok(num1 - num2),
+ Operation::Multiply => Ok(num1 * num2),
+ Operation::Divide => {
if *num2 == 0 {
Err(
InvalidOperation {