cameron-martin commented on PR #3045: URL: https://github.com/apache/thrift/pull/3045#issuecomment-2567949932
@jimexist the remaining issues can be fixed with this diff: ```patch diff --git a/compiler/cpp/src/thrift/generate/t_rs_generator.cc b/compiler/cpp/src/thrift/generate/t_rs_generator.cc index 780c8fd29..e336077e1 100644 --- a/compiler/cpp/src/thrift/generate/t_rs_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_rs_generator.cc @@ -749,8 +749,8 @@ void t_rs_generator::render_const_value(t_type* ttype, } else if (ttype->is_enum()) { f_gen_ << "{" << '\n'; indent_up(); - f_gen_ << indent() << to_rust_type(ttype) << "::try_from(" << tvalue->get_integer() - << ").expect(\"expecting valid const value\")" << '\n'; + f_gen_ << indent() << to_rust_type(ttype) << "::from(" << tvalue->get_integer() + << ")" << '\n'; indent_down(); f_gen_ << indent() << "}"; } else if (ttype->is_struct() || ttype->is_xception()) { diff --git a/test/rs/src/bin/test_client.rs b/test/rs/src/bin/test_client.rs index fd3a18550..801ccc4b5 100644 --- a/test/rs/src/bin/test_client.rs +++ b/test/rs/src/bin/test_client.rs @@ -252,10 +252,7 @@ fn make_thrift_calls( info!("testi64"); // try!(verify_expected_result(thrift_test_client.test_i64(-8651829879438294565), // -8651829879438294565)); - verify_expected_result( - thrift_test_client.test_i64(i64::min_value()), - i64::min_value(), - )?; + verify_expected_result(thrift_test_client.test_i64(i64::MIN), i64::MIN)?; info!("testDouble"); verify_expected_result( ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@thrift.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org