Skip to content

Commit b9cf706

Browse files
authored
[Rust] Inline generated header methods (#1110)
1 parent 4aff4cd commit b9cf706

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public SubGroup addSubGroup(final String name, final int level, final Token grou
130130

131131
void appendMessageHeaderEncoderFn(final Appendable out) throws IOException
132132
{
133+
indent(out, 2, "#[inline]\n");
133134
indent(out, 2, "pub fn header(self, offset: usize) -> MessageHeaderEncoder<Self> {\n");
134135
indent(out, 3, "let mut header = MessageHeaderEncoder::default().wrap(self, offset);\n");
135136
indent(out, 3, "header.block_length(SBE_BLOCK_LENGTH);\n");
@@ -142,6 +143,7 @@ void appendMessageHeaderEncoderFn(final Appendable out) throws IOException
142143

143144
void appendMessageHeaderDecoderFn(final Appendable out) throws IOException
144145
{
146+
indent(out, 2, "#[inline]\n");
145147
indent(out, 2, "pub fn header(self, mut header: MessageHeaderDecoder<ReadBuf<'a>>, offset: usize) -> Self {\n");
146148
indent(out, 3, "debug_assert_eq!(SBE_TEMPLATE_ID, header.template_id());\n");
147149
indent(out, 3, "let acting_block_length = header.block_length();\n");

0 commit comments

Comments
 (0)