diff options
author | AlephAlpha <alephalpha911@gmail.com> | 2021-07-09 16:34:58 +0800 |
---|---|---|
committer | Jens Geyer <Jens-G@users.noreply.github.com> | 2021-07-09 22:05:44 +0200 |
commit | c06ab4ccc97942f5956112713a0b3800a15cb6cc (patch) | |
tree | 276c3874804d622cd1a9805e61c88365d5f4832b /compiler | |
parent | b98e06df19497bb961a3ed160f4c3b8e0678ff86 (diff) | |
download | thrift-c06ab4ccc97942f5956112713a0b3800a15cb6cc.tar.gz |
Small bug in Rust generated code for writing container types
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/cpp/src/thrift/generate/t_rs_generator.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/cpp/src/thrift/generate/t_rs_generator.cc b/compiler/cpp/src/thrift/generate/t_rs_generator.cc index 40905c557..d6bc669aa 100644 --- a/compiler/cpp/src/thrift/generate/t_rs_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_rs_generator.cc @@ -1639,9 +1639,9 @@ void t_rs_generator::render_list_sync_write(const string &list_var, bool list_va f_gen_ << indent() << "for e in " << ref << list_var << " {" << endl; indent_up(); render_type_sync_write(string_container_write_variable(elem_type, "e"), true, elem_type); - f_gen_ << indent() << "o_prot.write_list_end()?;" << endl; indent_down(); f_gen_ << indent() << "}" << endl; + f_gen_ << indent() << "o_prot.write_list_end()?;" << endl; } void t_rs_generator::render_set_sync_write(const string &set_var, bool set_var_is_ref, t_set *tset) { @@ -1660,9 +1660,9 @@ void t_rs_generator::render_set_sync_write(const string &set_var, bool set_var_i f_gen_ << indent() << "for e in " << ref << set_var << " {" << endl; indent_up(); render_type_sync_write(string_container_write_variable(elem_type, "e"), true, elem_type); - f_gen_ << indent() << "o_prot.write_set_end()?;" << endl; indent_down(); f_gen_ << indent() << "}" << endl; + f_gen_ << indent() << "o_prot.write_set_end()?;" << endl; } void t_rs_generator::render_map_sync_write(const string &map_var, bool map_var_is_ref, t_map *tmap) { @@ -1684,9 +1684,9 @@ void t_rs_generator::render_map_sync_write(const string &map_var, bool map_var_i indent_up(); render_type_sync_write(string_container_write_variable(key_type, "k"), true, key_type); render_type_sync_write(string_container_write_variable(val_type, "v"), true, val_type); - f_gen_ << indent() << "o_prot.write_map_end()?;" << endl; indent_down(); f_gen_ << indent() << "}" << endl; + f_gen_ << indent() << "o_prot.write_map_end()?;" << endl; } string t_rs_generator::string_container_write_variable(t_type* ttype, const string& base_var) { |