Skip to content

Commit

Permalink
- update: generated rust code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
RavenX8 committed Dec 9, 2024
1 parent c99c4c2 commit c13019e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions generator/src/codegen/rust/codegen_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ impl<'a, W: Write> CodeSourceGenerator<'a, W> {
_ => {}
};
}
cg!(self, "Ok({} {{", packet.class_name().to_upper_camel_case());
cg!(self, "Ok(Self {{");
self.indent();
for content in packet.contents() {
use self::PacketContent::*;
match content {
Expand All @@ -139,6 +140,7 @@ impl<'a, W: Write> CodeSourceGenerator<'a, W> {
_ => {}
};
}
self.dedent();
cg!(self, "}})");
self.dedent();
cg!(self, "}}");
Expand Down Expand Up @@ -433,7 +435,7 @@ impl<'a, W: Write> CodeSourceGenerator<'a, W> {

cg!(self, "{}", maxValueCheck);
}
cg!(self, "Ok({} {{ {} }})", name.to_upper_camel_case(), data);
cg!(self, "Ok(Self {{ {} }})", data);
}
self.dedent();
cg!(self, "}}");
Expand Down

0 comments on commit c13019e

Please sign in to comment.