Github user allengeorge commented on a diff in the pull request: https://github.com/apache/thrift/pull/1147#discussion_r96126534 --- Diff: compiler/cpp/src/thrift/generate/t_rs_generator.cc --- @@ -2722,7 +2756,30 @@ string t_rs_generator::rust_namespace(t_service* tservice) { } string t_rs_generator::rust_struct_name(t_struct* tstruct) { - return rust_camel_case(tstruct->get_name()); + string base_struct_name(rust_camel_case(tstruct->get_name())); + if (is_reserved(base_struct_name)) { + return "Res" + base_struct_name; + } else { + return base_struct_name; + } +} + +string t_rs_generator::rust_field_name(t_field* tfield) { + string base_field_name(rust_snake_case(tfield->get_name())); + if (is_reserved(base_field_name)) { + return "res_" + base_field_name; --- End diff -- I agree. I've changed this as well - perhaps you were looking at an older version of the PR?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---