This is an automated email from the ASF dual-hosted git repository.

jfeinauer pushed a commit to branch feature/plc4rs
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/feature/plc4rs by this push:
     new 37295d97da Enable checksum fields
37295d97da is described below

commit 37295d97daee37d21aa4dac4af44299aa9d599c4
Author: julian <[email protected]>
AuthorDate: Mon Jun 6 15:09:45 2022 +0200

    Enable checksum fields
---
 .../src/main/resources/templates/rust/complex-type-template.rs.ftlh   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/code-generation/language-rust/src/main/resources/templates/rust/complex-type-template.rs.ftlh
 
b/code-generation/language-rust/src/main/resources/templates/rust/complex-type-template.rs.ftlh
index bfc84e4833..e79b54f723 100644
--- 
a/code-generation/language-rust/src/main/resources/templates/rust/complex-type-template.rs.ftlh
+++ 
b/code-generation/language-rust/src/main/resources/templates/rust/complex-type-template.rs.ftlh
@@ -160,6 +160,8 @@ pub struct ${type.name} {
     pub ${field.name}: 
${helper.getLanguageTypeNameForTypeReference(field.type)}<#sep>,</#sep>
     <#elseif field.isConstField()>
     // Intentionally do nothing
+    <#elseif field.isChecksumField()>
+    pub ${field.name}: 
${helper.getLanguageTypeNameForTypeReference(field.type)}<#sep>,</#sep>
     <#else>
         // -> ${field}
     </#if>
@@ -241,7 +243,7 @@ impl Message for ${type.name} {
         let ${field.name} = ${helper.getReadFunctionCall(field.type)};
     <#if field.isConstField()>
         // assert value of constant
-        assert!(${field.getReferenceValue().stringRepresentation()}, 
${field.name});
+        assert_eq!(${field.getReferenceValue().stringRepresentation()}, 
${field.name});
     </#if>
     </#if>
     </#list>

Reply via email to