summaryrefslogtreecommitdiff
path: root/system/gd/packet/parser/fields/struct_field.cc
diff options
context:
space:
mode:
Diffstat (limited to 'system/gd/packet/parser/fields/struct_field.cc')
-rw-r--r--system/gd/packet/parser/fields/struct_field.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/system/gd/packet/parser/fields/struct_field.cc b/system/gd/packet/parser/fields/struct_field.cc
index 75ad1abb05..6555e60bb2 100644
--- a/system/gd/packet/parser/fields/struct_field.cc
+++ b/system/gd/packet/parser/fields/struct_field.cc
@@ -96,10 +96,10 @@ void StructField::GenBoundsCheck(std::ostream&, Size, Size, std::string) const {
// implicitly checked by the struct parser
}
-void StructField::GenRustGetter(std::ostream& s, Size start_offset, Size) const {
+void StructField::GenRustGetter(std::ostream& s, Size start_offset, Size, std::string) const {
s << "let " << GetName() << " = ";
s << GetRustDataType() << "::parse(&bytes[" << start_offset.bytes() << "..";
- s << start_offset.bytes() + GetSize().bytes() << "]).unwrap();";
+ s << start_offset.bytes() + GetSize().bytes() << "])?;";
}
void StructField::GenRustWriter(std::ostream& s, Size start_offset, Size) const {