Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rust] Generate imports in alphabetical order. #997

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void generate() throws IOException
.filter((fileName) -> fileName.endsWith(".rs"))
.filter((fileName) -> !fileName.equals("lib.rs"))
.map((fileName) -> fileName.substring(0, fileName.length() - 3))
.sorted()
.forEach(modules::add);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public void generate() throws IOException
try (Writer out = outputManager.createOutput(codecModName))
{
indent(out, 0, "use crate::*;\n\n");
indent(out, 0, "pub use encoder::%sEncoder;\n", formatStructName(msgToken.name()));
indent(out, 0, "pub use decoder::%sDecoder;\n\n", formatStructName(msgToken.name()));
indent(out, 0, "pub use decoder::%sDecoder;\n", formatStructName(msgToken.name()));
indent(out, 0, "pub use encoder::%sEncoder;\n\n", formatStructName(msgToken.name()));
final String blockLengthType = blockLengthType();
final String templateIdType = rustTypeName(ir.headerStructure().templateIdType());
final String schemaIdType = rustTypeName(ir.headerStructure().schemaIdType());
Expand Down
Loading