pw_stream: Make MemoryWriter::data() non-const

Allows mutable access to a MemoryWriter's underlying buffer.

No-Docs-Update-Reason: Changing a data() accessor to non-const.
Change-Id: I02a1c21e670ba63f6de98441a851eddc03095cf5
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/45001
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
This commit is contained in:
Armando Montanez 2021-05-12 13:11:30 -07:00 committed by CQ Bot Account
parent 6230fa19cc
commit dc51315530

View File

@ -35,6 +35,7 @@ class MemoryWriter : public Writer {
ConstByteSpan WrittenData() const { return dest_.first(bytes_written_); }
std::byte* data() { return dest_.data(); }
const std::byte* data() const { return dest_.data(); }
private: