diff options
author | GREATEST Wiggler EvaR! <allen@actioniq.com> | 2018-11-09 07:54:32 -0500 |
---|---|---|
committer | James E. King III <jking@apache.org> | 2018-11-12 07:57:43 -0500 |
commit | b57d126157938e5bba4fc55125d73e7ac5bf11a2 (patch) | |
tree | 61125d3118eb074c44b574775af9d9983b19b4ff /tutorial/rs | |
parent | 6436899e4723d4a22eac107041019aa981226237 (diff) | |
download | thrift-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.rs | 4 | ||||
-rw-r--r-- | tutorial/rs/src/bin/tutorial_server.rs | 8 |
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 { |