Skip to content

Name the consuming getter into_payload #305

@coderabbitai

Description

@coderabbitai

Follow Rust idioms for consuming accessors. Provide a non-breaking path by adding into_payload(self) and deprecating payload(self).

Proposed Change

     #[must_use]
-    pub fn payload(self) -> Vec<u8> { self.payload }
+    pub fn into_payload(self) -> Vec<u8> { self.payload }

Tasks

  • Add into_payload(self) -> Vec<u8> method to PacketParts
  • Deprecate existing payload(self) -> Vec<u8> method
  • Update internal examples and call sites to use into_payload()
  • Ensure backwards compatibility during transition period

Context

Raised in PR #282: #282
Original comment: #282 (comment)

Requested by: @leynos

Metadata

Metadata

Assignees

Labels

lowAin't annoying anyone but the QA department

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions