[ 
https://issues.apache.org/jira/browse/THRIFT-2945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15822985#comment-15822985
 ] 

ASF GitHub Bot commented on THRIFT-2945:
----------------------------------------

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?


> Implement support for Rust language
> -----------------------------------
>
>                 Key: THRIFT-2945
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2945
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Wish List
>            Reporter: Maksim Golov
>            Assignee: Jeremy Fitzhardinge
>
> Work on implementing support for Rust is in progress: 
> https://github.com/maximg/thrift by Simon Génier and myself.
> It will probably take quite some time to complete. Please keep us updated if 
> there are changes related to our work.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to