Skip to content

Commit

Permalink
style[rust]: format rust code style
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Jul 21, 2024
1 parent 293ccb4 commit ae47b1b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public String readObject(StringBuilder builder, int deep, Field field, IFieldReg
GenerateProtocolFile.addTab(builder, deep);
builder.append(StringUtils.format("if {} > 0 {", size)).append(LS);
GenerateProtocolFile.addTab(builder, deep + 1);
builder.append(StringUtils.format("for {} in 0 .. {} {", i, size)).append(LS);
builder.append(StringUtils.format("for {} in 0..{} {", i, size)).append(LS);
String readObject = CodeGenerateRust.rustSerializer(arrayField.getArrayElementRegistration().serializer())
.readObject(builder, deep + 2, field, arrayField.getArrayElementRegistration());
GenerateProtocolFile.addTab(builder, deep + 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public String readObject(StringBuilder builder, int deep, Field field, IFieldReg

GenerateProtocolFile.addTab(builder, deep + 1);
String i = "index" + GenerateProtocolFile.localVariableId++;
builder.append(StringUtils.format("for {} in 0 .. {} {", i, size)).append(LS);
builder.append(StringUtils.format("for {} in 0..{} {", i, size)).append(LS);
String readObject = CodeGenerateRust.rustSerializer(listField.getListElementRegistration().serializer())
.readObject(builder, deep + 2, field, listField.getListElementRegistration());
GenerateProtocolFile.addTab(builder, deep + 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public String readObject(StringBuilder builder, int deep, Field field, IFieldReg

String i = "index" + GenerateProtocolFile.localVariableId++;
GenerateProtocolFile.addTab(builder, deep + 1);
builder.append(StringUtils.format("for {} in 0 .. {} {", i, size)).append(LS);
builder.append(StringUtils.format("for {} in 0..{} {", i, size)).append(LS);
String keyObject = CodeGenerateRust.rustSerializer(mapField.getMapKeyRegistration().serializer())
.readObject(builder, deep + 2, field, mapField.getMapKeyRegistration());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public String readObject(StringBuilder builder, int deep, Field field, IFieldReg

GenerateProtocolFile.addTab(builder, deep + 1);
String i = "index" + GenerateProtocolFile.localVariableId++;
builder.append(StringUtils.format("for {} in 0 .. {} {", i, size)).append(LS);
builder.append(StringUtils.format("for {} in 0..{} {", i, size)).append(LS);
String readObject = CodeGenerateRust.rustSerializer(setField.getSetElementRegistration().serializer())
.readObject(builder, deep + 2, field, setField.getSetElementRegistration());
GenerateProtocolFile.addTab(builder, deep + 2);
Expand Down

0 comments on commit ae47b1b

Please sign in to comment.