summaryrefslogtreecommitdiff
path: root/system/gd/packet/parser/fields/struct_field.cc
diff options
context:
space:
mode:
authorRob Seymour <rseymour@google.com>2022-04-02 03:52:13 +0000
committerRob Seymour <rseymour@google.com>2022-04-02 04:01:22 +0000
commit4c7dc59bef24cc991251f9a7924ceada90c6bd63 (patch)
treea90550aa3ce1bc5e002ab6444c96954deca81af0 /system/gd/packet/parser/fields/struct_field.cc
parent6fa2bea006b362a285f744f65f15b5902e55797a (diff)
parentdd4d23c4e1de011f8cd4eb132422172d5e283a73 (diff)
Merge TP1A.220328.001
Change-Id: I5f07094ba2fb3991da03673f97d2957b1f68018b
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 {