Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3c8dc47 authored by Zach Johnson's avatar Zach Johnson
Browse files

rusty-gd: don't put payloads, the size has already been allocated

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost
Change-Id: Ie360848be3abef6b40573d04a2539eadd0d824d2
parent cf43afcc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -995,7 +995,8 @@ void PacketDef::GenRustStructImpls(std::ostream& s) const {
      s << name_ << "DataChild::" << child->name_ << "(value) => value.write_to(buffer),";
    }
    if (fields_.HasPayload()) {
      s << name_ << "DataChild::Payload(p) => buffer.put(&p[..]),";
      auto offset = GetOffsetForField("payload");
      s << name_ << "DataChild::Payload(p) => buffer[" << offset.bytes() << "..].copy_from_slice(&p[..]),";
    }
    s << name_ << "DataChild::None => {}";
    s << "}";