Skip to content

Commit 7ce24c3

Browse files
gierlachgZachBray
authored andcommitted
[Rust] Generate imports in alphabetical order.
1 parent a5e12d1 commit 7ce24c3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/rust/LibRsDef.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ void generate() throws IOException
7373
.filter((fileName) -> fileName.endsWith(".rs"))
7474
.filter((fileName) -> !fileName.equals("lib.rs"))
7575
.map((fileName) -> fileName.substring(0, fileName.length() - 3))
76+
.sorted()
7677
.forEach(modules::add);
7778
}
7879

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/rust/RustGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ public void generate() throws IOException
152152
try (Writer out = outputManager.createOutput(codecModName))
153153
{
154154
indent(out, 0, "use crate::*;\n\n");
155-
indent(out, 0, "pub use encoder::%sEncoder;\n", formatStructName(msgToken.name()));
156-
indent(out, 0, "pub use decoder::%sDecoder;\n\n", formatStructName(msgToken.name()));
155+
indent(out, 0, "pub use decoder::%sDecoder;\n", formatStructName(msgToken.name()));
156+
indent(out, 0, "pub use encoder::%sEncoder;\n\n", formatStructName(msgToken.name()));
157157
final String blockLengthType = blockLengthType();
158158
final String templateIdType = rustTypeName(ir.headerStructure().templateIdType());
159159
final String schemaIdType = rustTypeName(ir.headerStructure().schemaIdType());

0 commit comments

Comments
 (0)