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

Commit a03c64d0 authored by Chih-Yu Huang's avatar Chih-Yu Huang
Browse files

Packetgen: make struct derive PartialEq trait in Rust

This CL add #[derive(PartialEq)] annotation for the struct type. This
trait is useful when comparing data in the unit test.

Bug: 233319010
Test: m bluetooth_packetgen
Change-Id: I7fe4c7b505547ef8127f175eae42d23ac2fd1710
parent 24100d9d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ void StructDef::GenRustFieldNames(std::ostream& s) const {
}

void StructDef::GenRustDeclarations(std::ostream& s) const {
  s << "#[derive(Debug, Clone)] ";
  s << "#[derive(Debug, Clone, PartialEq)] ";
  s << "pub struct " << name_ << "{";

  // Generate struct fields